Abdullah bin Abbas reported,

The Prophet ﷺ took one of his daughters who was dying and held her close, placing her between his breast. She passed away while resting against his chest.Umm Ayman cried out, and someone said to her, "Are you weeping in the presence of the Messenger of Allah?"She replied, "Do I not see you weeping, Messenger of Allah?"He said, "I am not weeping. This is mercy. The believer is in a state of goodness in every condition. Even as his soul departs from between his sides, he is praising Allah عز وجل."

Azami 10800

Sahih

عن ابن عباس قال

أخذ النبي ﷺ بنتا له تقضي، فاحتضنها، فوضعها بين ثدييه فماتت وهي بين ثدييه، فصاحت أم أيمن فقيل: أتبكي عند رسول الله؟ قالت: ألست أراك تبكي يا رسول الله؟ قال: لست أبكي، إنما هي رحمة، إن المؤمن بكل خير على كل حال، إن نفسه تخرج من بين جنبيه، وهو يحمد الله عز وجل.

الأعظمي 10800صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Supplications
Section
A believer praises Allah in every situation
Numbering
Jami al-Kamil 10800 (2nd edition)
Azami 10800