Bhagavad Gita · 6.6
बन्धुरात्मात्मनस्तस्य येनात्मैवात्मना जितः।अनात्मनस्तु शत्रुत्वे वर्तेतात्मैव शत्रुवत्॥
bandhur ātmātmanas tasya yenātmaivātmanā jitaḥ anātmanas tu śhatrutve vartetātmaiva śhatru-vat
For one who has conquered the self by the self, the self is a friend. But for one who has not conquered the self, the self acts as an enemy, like an external foe.
— Bhagavad Gita 6.6
Source: Sacred-Texts.com (Sanskrit) + Bhagavad-Gita.io (translations)