Umar bin Abu Salamah narrated from his mother, Umm Salamah, that the Messenger of Allah (ﷺ) said:
“When a calamity strikes one of you, then let him say: ‘Indeed, to Allah we belong and to Him we shall return. O Allah, I seek reward with You for my affliction, so reward me for it, and replace it for me with something better (Innā lillāhi wa innā ilaihi rāji`ūn, Allāhumma `indaka aḥtasibu muṣībatī fa’jurnī fīhā wa abdilnī minhā khair).’” When the time of death was near Abu Salamah, he said: ‘O Allah, replace me for my wife, with better than me.” So when he died, Umm Salamah said: “Indeed, to Allah we belong and to Him we shall return. I seek reward with Allah for my affliction, so reward me for it.”