Valmiki Ramayana Sundara Kanda Sarga 51 Shloka 25
Original Shlokaतपस्सन्तापलब्धस्ते योऽयं धर्मपरिग्रहः। न स नाशयितुं न्याय्य आत्मप्राणपरिग्रहः।।5.51.25।।
1 source checked for this shloka
तपस्सन्तापलब्ध: obtained by the the virtue of austerity, ते to you, यः that, अयम् this, धर्मपरिग्रहः accumlation of righteousness, आत्मप्राणपरिग्रहः at the cost of your life, सः that, नाशयितुम् to destroy, न न्याय्यः not proper.
"You have acquired the merit of righteousness by prolonged hardships experienced during your penance. It is not proper to forfeit your own life in this way.