Bhagavad Gita 16.22

Chapter 16: Divine and demonic natures

एतैर्विमुक्तः कौन्तेय तमोद्वारैस्त्रिभिर्नरः ।
आचरत्यात्मनः श्रेयस्ततो याति परां गतिम् ॥ २२ ॥

A man liberated from these three gates of darkness, O son of Kunti, accomplisheth his own welfare, and thus reacheth the highest goal.

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