Bhagavad Gita 18.54

Chapter 18: Freedom through renunciation

ब्रह्मभूतः प्रसन्नात्मा न शोचति न काङ्क्षति ।
समः सर्वेषु भूतेषु मद्भक्तिं लभते पराम् ॥ ५४ ॥

Becoming the Eternal, serene in the Self, he neither grieveth nor desireth; the same to all beings, he obtaineth supreme devotion unto Me.

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