Bhagavad Gita · 6.18
यदा विनियतं चित्तमात्मन्येवावतिष्ठते।निःस्पृहः सर्वकामेभ्यो युक्त इत्युच्यते तदा॥
yadā viniyataṁ chittam ātmany evāvatiṣhṭhate niḥspṛhaḥ sarva-kāmebhyo yukta ity uchyate tadā
When the perfectly disciplined mind rests in the Self alone, free from longing for all desires — then one is said to be united in yoga.
— Bhagavad Gita 6.18
Source: Sacred-Texts.com (Sanskrit) + Bhagavad-Gita.io (translations)