Al-Adab Al-Mufrad 501
Anas bin Maalik has reported that the Prophet (ﷺ) said, "When Allah involves a Muslim in bodily [pain then he is credited with a reward for those deeds which he was used to do when he was healthy as long as he is ill. Thus, if Allah gives him healing, He washes him (clean of sins). But, if he causes him to die then he forgives him.
حَدَّثَنَا عَارِمٌ، قَالَ: حَدَّثَنَا سَعِيدُ بْنُ زَيْدٍ، قَالَ: حَدَّثَنَا سِنَانٌ أَبُو رَبِيعَةَ، قَالَ: حَدَّثَنَا أَنَسُ بْنُ مَالِكٍ، عَنِ النَّبِيِّ ﷺ قَالَ: مَا مِنْ مُسْلِمٍ ابْتَلاَهُ اللَّهُ فِي جَسَدِهِ إِلاَّ كُتِبَ لَهُ مَا كَانَ يَعْمَلُ فِي صِحَّتِهِ، مَا كَانَ مَرِيضًا، فَإِنْ عَافَاهُ، أُرَاهُ قَالَ: عَسَلَهُ، وَإِنْ قَبَضَهُ غَفَرَ لَهُ.
حدثنا موسى قال: حدثنا حماد بن سلمة، عن ينام عن أني، عن النبي ﷺ مثله وزاد (قال: فإن شفاه عسله).