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
Hadith No. 5640
Sahih al Bukhari