The Prophet ﷺ said, "No fatigue, nor disease, nor sorrow, nor sadness, nor hurt, nor distress befalls a Muslim, even if it were the prick he receives from a thorn, but that Allah expiates some of his sins for that." (Using translation from Bukhārī 5641)
أَنَّ النَّبِيَّ ﷺ قَالَ مَا يُصِيبُ الْمَرْءَ الْمُسْلِمَ مِنْ نَصَبٍ وَلَا وَصَبٍ وَلَا هَمٍّ وَلَا حُزْنٍ وَلَا غَمٍّ وَلَا أَذًى حَتَّى الشَّوْكَةَ يُشَاكُهَا إِلَّا كَفَّرَ اللهُ عَنْهُ بِهَا مِنْ خَطَايَاهُ