Valmiki Ramayana Aranya Kanda Sarga 53 Shloka 16
Original Shlokaन नूनं चात्मनः पथ्यं श्रेयो वा समवेक्षसे।।3.53.16।। मृत्युकाले यथा मर्त्यो विपरीतानि सेवते।
1 source checked for this shloka
मर्त्य: a mortal, मृत्युकाले at the time of death, यथा as, विपरीतानि very differently, सेवते he will resort to, आत्मनः your own, पथ्यम् whatever is beneficial to you, श्रेयो वा your welfare, न समवेक्षसे you are not able to foresee.
At the time of death, mortals behave very differently. They act contrary to their own welfare. Likewise you are not able to foresee what is beneficial and good for you.