Bhagavad Gita 2.55

Chapter 2: The yoga of knowledge

प्रजहाति यदा कामान्सर्वान्पार्थ मनोगतान् ।
आत्मन्येवात्मना तुष्टः स्थितप्रज्ञस्तदोच्यते ॥ ५५ ॥

When a man abandoneth, O Pârtha, all the desires of the heart, and is satisfied in the Self by the Self, then is he called stable in mind.

Sanskrit text and English translation: Annie Besant, The Bhagavad-Gita, 4th edition (1922) — public domain, via Wikisource. Chapter summaries: SamayaVeda.