Jami` at-Tirmidhi, Volume 6, Book 45, Hadith 3511 (DarusSalam) ⓘ
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.”
حَدَّثَنَا إِبْرَاهِيمُ بْنُ يَعْقُوبَ، حَدَّثَنَا عَمْرُو بْنُ عَاصِمٍ، حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ، عَنْ ثَابِتٍ، عَنْ عَمْرِو بْنِ أَبِي سَلَمَةَ، عَنْ أُمِّهِ أُمِّ سَلَمَةَ، عَنْ أَبِي سَلَمَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ " إِذَا أَصَابَ أَحَدَكُمْ مُصِيبَةٌ فَلْيَقُلْ : ( إنَّا لِلَّهِ وَإِنَّا إِلَيْهِ رَاجِعُونَ ) اللَّهُمَّ عِنْدَكَ احْتَسَبْتُ مُصِيبَتِي فَأْجُرْنِي فِيهَا وَأَبْدِلْنِي مِنْهَا خَيْرًا " . فَلَمَّا احْتُضِرَ أَبُو سَلَمَةَ قَالَ اللَّهُمَّ اخْلُفْ فِي أَهْلِي خَيْرًا مِنِّي فَلَمَّا قُبِضَ قَالَتْ أُمُّ سَلَمَةَ : ( إنَّا لِلَّهِ وَإِنَّا إِلَيْهِ رَاجِعُونَ ) عِنْدَ اللَّهِ احْتَسَبْتُ مُصِيبَتِي فَأْجُرْنِي فِيهَا . قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ غَرِيبٌ مِنْ هَذَا الْوَجْهِ . وَرُوِيَ هَذَا الْحَدِيثُ مِنْ غَيْرِ هَذَا الْوَجْهِ عَنْ أُمِّ سَلَمَةَ عَنِ النَّبِيِّ صلى الله عليه وسلم وَأَبُو سَلَمَةَ اسْمُهُ عَبْدُ اللَّهِ بْنُ عَبْدِ الأَسَدِ .
also referenced under: Hadith 3511 (Reference) & Book 48, Hadith 142 (In-Book)