The Book of Virtue, Enjoining Good Manners, and Joining of the Ties of Kinship
Ṣaḥīḥ Muslim 6567
مَا مِنْ شَىْءٍ يُصِيبُ الْمُؤْمِنَ حَتَّى الشَّوْكَةِ تُصِيبُهُ إِلاَّ كَتَبَ اللَّهُ لَهُ بِهَا حَسَنَةً أَوْ حُطَّتْ عَنْهُ بِهَا خَطِيئَةٌ
mā min shayʾin yuṣību al-muʾmina ḥattā ash-shawkah tuṣībuhu illā kataba-Llāh lah bihā ḥasanatan aw ḥuṭṭat ʿanhu bihā khaṭīʾatun
Transliteration generated from the Arabic vowel marks
The full narration
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
Source
Ṣaḥīḥ Muslim · 6567
Ṣaḥīḥ