Valmiki Ramayana Ayodhya Kanda Sarga 13 Shloka 12
Original Shlokaयदि दुःखमकृत्वाऽद्य मम संक्रमणं भवेत्। अदुःखार्हस्य रामस्य तत स्सुखमवाप्नुयाम्।।2.13.12।।
1 source checked for this shloka
अदुःखार्हस्य one who does not deserve suffering, रामस्य of Rama, दुःखम् sorrow, अकृत्वा not inflicting, मम my, संक्रमणम् reaching death, अद्य now, भवेत् if it happens, ततः therefrom, सुखम् happiness, अवाप्नुयाम् I shall experience.
If death comes to me right now I shall be very happy because I will not have to inflict suffering on Rama who does not deserve it.