Messenger of Allah ﷺ said: There is no trouble that comes to a believer except that it obliterates from his sins, even if it is the pricking of a thorn (Using translation from Muslim 2572e)
أَنَّ رَسُولَ اللهِ ﷺ قَالَ «مَا مِنْ مُصِيبَةٍ يُصَابُ بِهَا الْمُؤْمِنُ إِلَّا كُفِّرَ حَتَّى الشَّوْكَةِ يُشَاكُهَا»