Bhagavad Gita 6.5
Let him seek liberation with the help of his Highest Self, and never disgrace his own Self. For that Self is his only friend; yet it can also be his enemy.
उद्धरेदात्मनाऽऽत्मानं नात्मानमवसादयेत्।
आत्मैव ह्यात्मनो बन्धुरात्मैव रिपुरात्मनः॥uddharedātmanā''tmānaṃ nātmānamavasādayet|
ātmaiva hyātmano bandhurātmaiva ripurātmanaḥ||
English translation (above): Shri Purohit Swami (1935), public domain. Sanskrit text via github.com/gita/gita (Unlicense).