Abdullah bin Masud reported,

I came to visit the Prophet ﷺ while he was suffering from a fever. I touched him with my hand and said, "You are burning with a severe fever."He replied, "Yes, the way two men among you would burn with fever."I asked, "Is that because you have a double reward?"He said, "Yes. No Muslim is afflicted by any harm, whether illness or anything else, without Allah causing his sins to fall away as a tree sheds its leaves."

Bukhari 5667

Sahih

حدثنا موسى حدثنا عبد العزيز بن مسلم حدثنا سليمان عن إبراهيم التيمي عن الحارث بن سويد

عن ابن مسعود رضي الله عنه قال

دخلت على النبي ﷺ وهو يوعك فمسسته بيدي فقلت إنك لتوعك وعكا شديدا قال أجل كما يوعك رجلان منكم قال لك أجران قال نعم ما من مسلم يصيبه أذى مرض فما سواه إلا حط الله سيئاته كما تحط الشجرة ورقها

البخاري 5667صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Sick
Chapter
Sick person saying "I am in pain" or "Oh my head" or "The pain has intensified for me"
Numbering
Darussalam 5667
Bukhari 5667