Sahih al-Bukhari, Hadith 5640 ⓘ
Narrated `Aisha: (the wife of the Prophet) Allah's Messenger said, "No calamity befalls a Muslim but that Allah expiates some of his sins because of it, even though it were the prick he receives from a thorn."
حَدَّثَنَا أَبُو الْيَمَانِ الْحَكَمُ بْنُ نَافِعٍ، أَخْبَرَنَا شُعَيْبٌ، عَنِ الزُّهْرِيِّ، قَالَ أَخْبَرَنِي عُرْوَةُ بْنُ الزُّبَيْرِ، أَنَّ عَائِشَةَ ـ رضى الله عنها ـ زَوْجَ النَّبِيِّ صلى الله عليه وسلم قَالَتْ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " مَا مِنْ مُصِيبَةٍ تُصِيبُ الْمُسْلِمَ إِلاَّ كَفَّرَ اللَّهُ بِهَا عَنْهُ، حَتَّى الشَّوْكَةِ يُشَاكُهَا " .
also referenced under: Book 75, Hadith 1 (In-Book) & Volume 7, Book 70, Hadith 544 (USC-MSA)