It was from the supplication of the Prophet, peace be upon him:
O Allah, By Your knowledge of the unseen and Your power over creation, Keep me alive as long as You know life is good for me, And take my soul when You know death is better for me. I ask You for fear of You in secret and in public, And I ask You for the word of truth in satisfaction and anger. I ask You for moderation in poverty and wealth, And I ask You for blessings that never end and a joy that never ceases. I ask You for contentment after decree, And I ask You for the coolness of life after death. I ask You for the pleasure of looking at Your face and the longing to meet You, Without any distressing harm or misleading trial.
O Allah, Adorn us with the adornment of faith and make us guiding and rightly guided.
Narrated by An-Nasa'i and authenticated by Al-Albani