Umm Ala reported,

The Messenger of Allah ﷺ visited me while I was sick and said, "Rejoice, Umm Ala, for the illness of a Muslim causes Allah to remove his sins just as fire removes the impurities of gold and silver."

Azami 3419

Sahih

عن أم العلاء، قالت

عادني رسول الله ﷺ وأنا مريضة فقال: أبشري يا أم العلاء؛ فإن مرض المسلم يذهب الله به خطاياه كما تذهب النار خبث الذهب والفضة.

الأعظمي 3419صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Patience in tribulation and illness
Section
Reward of the believer for what afflicts him of illness, grief, or the like
Numbering
Jami al-Kamil 3419 (2nd edition)
Azami 3419