Bhagavad Gita 16.22
एतैर्विमुक्तः कौन्तेय तमोद्वारैस्त्रिभिर्नरः। आचरत्यात्मनः श्रेयस्ततो याति परां गतिम्।।16.22।।
etairvimuktaḥ kaunteya tamodvāraistribhirnaraḥ| ācaratyātmanaḥ śreyastato yāti parāṃ gatim||16.22||
etairvimuktah kaunteya tamodvaraistribhirnarah acaratyatmanah shreyastato yati param gatim16.22
Meaning
One who is freed from these three gates of darkness practices what is good for the self and thus attains the supreme goal.
हे कौन्तेय! नरक के इन तीनों द्वारों से विमुक्त पुरुष अपने कल्याण के साधन का आचरण करता है और इस प्रकार परा गति को प्राप्त होता है।
This is verse 22 of 24 in Chapter 16 (Daivasura Sampad Vibhaga Yoga) of the Bhagavad Gita.