Valmiki Ramayana Yuddha Kanda Sarga 32 Shloka 14
Original Shlokaअदृष्टंमृत्युमापन्नःकस्मात्त्वंनयशास्त्रवित् । व्यसनानामुपायज्ञःकुशलोह्यसिवर्जने ।।6.32.14।।
1 source checked for this shloka
नयशास्त्रवित् knower of all sastras, त्वम् you, कस्मात् how did you meet, अदृष्टम् by chance, मृत्युम् death, आपन्नः overtakes you, उपायज्ञः ways of getting out, व्यसनानाम् calamities, वर्जने to ward off, कुशलः capable, असिहि you are also.
"You are the knower of all sastras, and capable of warding off all calamities. How did death have a chance to meet you and overtake?"