Hadithcore
Al-Adab Al-Mufrad, 497

It is reported by Ayeshah that the Prophet (ﷺ) said, "When a Believer falls ill, Allah cleans him of sin as a kiln removes the rust from iron".

حَدَّثَنَا إِبْرَاهِيمُ بْنُ الْمُنْذِرِ، قَالَ‏:‏ حَدَّثَنَا عِيسَى بْنُ الْمُغِيرَةِ، عَنِ ابْنِ أَبِي ذِئْبٍ، عَنْ جُبَيْرِ بْنِ أَبِي صَالِحٍ، عَنِ ابْنِ شِهَابٍ، عَنْ عُرْوَةَ، عَنْ عَائِشَةَ رَضِيَ اللَّهُ عَنْهَا، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ‏:‏ إِذَا اشْتَكَى الْمُؤْمِنُ أَخْلَصَهُ اللَّهُ كَمَا يُخَلِّصُ الْكِيرُ خَبَثَ الْحَدِيدِ‏.‏

References2 variants
In-Book Reference
Book 29, Hadith 7
English Reference
Book 29, Hadith 497