Valmiki Ramayana Kishkindha Kanda Sarga 63 Shloka 5
Original Shlokaउत्थितां मरणे बुद्धिं मुनिवाक्यैर्निवर्तये। बुद्धिर्या तेन मे दत्ता प्राणानां रक्षणाय तु।।4.63.5।। सा मेऽपनयते दुःखं दीप्तेवाग्निशिखा तमः।
1 source checked for this shloka
मरणे for death, उत्थिम् intending, बुद्धिम् my mind, मुनिवाक्यैः sage's words, निवर्तये I avert, मे my, प्राणानाम् of life, रक्षणे in protecting, तेन by him, मे my, या such, बुद्धिः thought, दत्ता is given, सा that, दीप्ता glowing, अग्निशिखा like the flames of fire, तमः इव like darkness, मे my, दु:खम् agony, अपनयते take away.
'Whenever I intended to die, the words of the sage rang in my mind. The inspiration he gave me to preserve my life removed my agony like the glowing flames of fire that take away darkness.