Ammar bin Yasir reported,

I heard the Messenger of Allah ﷺ say in his prayer, "O Allah, by Your knowledge of the unseen and Your power over creation, keep me alive as long as You know that life is best for me, and take me when You know that death is best for me. O Allah, I ask You for awe of You in private and in public. I ask You for the word of truth in times of contentment and anger. I ask You for moderation in poverty and in wealth. I ask You for blessings that never cease, and for delight of the eye that never ends. I ask You for contentment after Your decree, and for the coolness of life after death. I ask You for the pleasure of gazing upon Your Face, and the longing to meet You, without any harmful affliction or misleading trial. O Allah, adorn us with the beauty of faith, and make us guides who are rightly guided."

Azami 11039

Sahih

عن عمار بن ياسر قال

سمعت رسول الله ﷺ يقول في صلاته: اللهم بعلمك الغيب، وقدرتك على الخلق أحيني ما علمت الحياة خيرا لي، وتوفني إذا علمت الوفاة خيرا لي، اللهم أسألك خشيتك- يعني في الغيب والشهادة-، وأسألك كلمة الحق في الرضا والغضب، وأسألك القصد في الفقر والغنى، وأسألك نعيما لا ينفد، وأسألك قرة عين لا تنقطع، وأسألك الرضا بعد القضاء، وأسألك برد العيش بعد الموت، وأسألك لذة النظر إلى وجهك، والشوق إلى لقائك في غير ضراء مضرة، ولا فتنة مضلة، اللهم زينا بزينة الإيمان، واجعلنا هداة مهتدين.

الأعظمي 11039صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Supplications of adhan and prayer, and what is related to them
Section
Supplications before the taslim
Numbering
Jami al-Kamil 11039 (2nd edition)
Azami 11039