«إذا ابتلى الله العبد المسلم ببلاء في جسده قال الله عز وجل: أكتب له صالح عمله فإن شفاه غسله وطهره وإن قبضه غفر له ورحمه»
The Prophet (peace and blessings be upon him) said:
"When Allah Almighty afflicts a Muslim servant with an illness in his body, Allah, the Mighty and Majestic, says (to the angels): 'Keep recording for him the good deeds (he used to do while healthy).' Then, if Allah cures him, He washes him clean of sins and purifies him, and if He takes his soul, He forgives him and has mercy on him."
Hadith Referenceصحیح الجامع الصغیر / حرف الألف / 258