Hadith 1560

Anas reported God’s messenger as saying, “When a Muslim is afflicted with some trouble in his body the angel is told to record for him his good deeds which he was accustomed to do. Then if God cures him He washes and purifies him [from sins], and if He takes him in death He forgives him and shows mercy to him.” Transmitted in Sharh as-sunna.

وَعَنْ أَنَسٍ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: " إِذَا ابْتُلِيَ الْمُسْلِمُ بِبَلَاءٍ فِي جَسَدِهِ قِيلَ لِلْمَلَكِ: اكْتُبْ لَهُ صَالِحَ عَمَلِهِ الَّذِي كَانَ يَعْمَلُ فَإِنْ شَفَاهُ غَسَّلَهُ وَطَهَّرَهُ وَإِنْ قَبَضَهُ غَفَرَ لَهُ وَرَحِمَهُ ". رَوَاهُمَا فِي شرح السّنة

Reference: 5615600
In-book reference: Book 5, Hadith 1560