I heard Messenger of Allah ﷺ as saying: There is nothing (in the form of trouble) that comes to a believer even if it is the pricking of a thorn that there is decreed for him by Allah good or his sins are obliterated.
سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ مَا مِنْ شَىْءٍ يُصِيبُ الْمُؤْمِنَ حَتَّى الشَّوْكَةِ تُصِيبُهُ إِلاَّ كَتَبَ اللَّهُ لَهُ بِهَا حَسَنَةً أَوْ حُطَّتْ عَنْهُ بِهَا خَطِيئَةٌ