Bhagavad Gita · 4.22
यदृच्छालाभसन्तुष्टो द्वन्द्वातीतो विमत्सरः।समः सिद्धावसिद्धौ च कृत्वापि न निबध्यते॥
yadṛichchhā-lābha-santuṣhṭo dvandvātīto vimatsaraḥ samaḥ siddhāv asiddhau cha kṛitvāpi na nibadhyate
Content with whatever comes unsought, beyond the pairs of opposites, free from envy, and even-minded in success and failure — such a person, even while acting, is never bound.
— Bhagavad Gita 4.22
Source: Sacred-Texts.com (Sanskrit) + Bhagavad-Gita.io (translations)