Bhagavad Gita Chapter 5, Verse 23
शक्नोतीहैव यः सोढुं प्राक्शरीरविमोक्षणात् | कामक्रोधोद्भवं वेगं स युक्तः स सुखी नरः ||
śaknotīhaiva yaḥ soḍhuṁ prāk śarīra-vimokṣaṇāt kāma-krodhodbhavaṁ vegaṁ sa yuktaḥ sa sukhī naraḥ
He who is able to withstand the urge born of desire and anger here itself, before giving up the body, is a yogi, and he is a happy person.
Krishna describes the yogi's ability: one who is able (śaknoti) to withstand (soḍhum) the urge (vegam) born of desire and anger (kāma-krodhodbhavam) here itself (iha eva), before giving up the body (prāk śarīra-vimokṣaṇāt), is a yogi (sa yuktaḥ), and he is a happy person (sa sukhī naraḥ). This means the yogi doesn't wait for death to overcome desire and anger—they overcome them while living. The ability to withstand the impulses born of desire and anger is the mark of a yogi. This is the practical test of karma yoga—can you withstand the urges of desire and anger while performing your duties? If you can, you're a yogi and you're happy.