Ammar bin Yasir reported,

"I have made supplications that I heard from the Messenger of Allah ﷺ. He said, 'O Allah, by Your knowledge of the unseen and Your power over creation, keep me alive so long as You know that life is best for me, and take me to You when You know that death is best for me. O Allah, I ask You for fear of You in private and in public. I ask You for the word of truth in moments of anger and contentment. I ask You for moderation in poverty and in wealth. I ask You for blessings that never end and joy of the eye that never ceases. I ask You for contentment after Your decree. I ask You for the coolness of life after death. I ask You for the delight 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 252

Sahih

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

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

الأعظمي 252صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Faith in Allah عز وجل
Section
Affirmation of the knowledge of Allah the Exalted
Numbering
Jami al-Kamil 252 (2nd edition)
Azami 252