Sahih Muslim , Book 45, Hadith 65 (In-Book)

'A'isha reported: I heard Allah's Messenger 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.

حَدَّثَنِي حَرْمَلَةُ بْنُ يَحْيَى، أَخْبَرَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، أَخْبَرَنَا حَيْوَةُ، حَدَّثَنَا ابْنُ الْهَادِ، عَنْ أَبِي بَكْرِ بْنِ حَزْمٍ، عَنْ عَمْرَةَ، عَنْ عَائِشَةَ، قَالَتْ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ مَا مِنْ شَىْءٍ يُصِيبُ الْمُؤْمِنَ حَتَّى الشَّوْكَةِ تُصِيبُهُ إِلاَّ كَتَبَ اللَّهُ لَهُ بِهَا حَسَنَةً أَوْ حُطَّتْ عَنْهُ بِهَا خَطِيئَةٌ ‏" ‏ ‏.‏

sunnah.com