Abdullah bin Masud reported,

I came to the Prophet ﷺ during his illness and touched him, and he was suffering from a severe fever. I said, "You are suffering a very severe fever, and that is because you have a double reward."He replied, "Yes. No Muslim is afflicted by any harm except that his sins fall away from him as the leaves fall from a tree."

Bukhari 5661

Sahih

حدثنا قبيصة حدثنا سفيان عن الأعمش عن إبراهيم التيمي عن الحارث بن سويد

عن عبد الله رضي الله عنه قال

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

البخاري 5661صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Sick
Chapter
What is said to the sick person and what he replies
Numbering
Darussalam 5661
Bukhari 5661