The Book of Virtue, Enjoining Good Manners, and Joining of the Ties of Kinship
Ṣaḥīḥ Muslim 6566
لاَ يُصِيبُ الْمُؤْمِنَ مِنْ مُصِيبَةٍ حَتَّى الشَّوْكَةِ إِلاَّ قُصَّ بِهَا مِنْ خَطَايَاهُ أَوْ كُفِّرَ بِهَا مِنْ خَطَايَاهُ
lā yuṣību al-muʾmina min muṣībatin ḥattā ash-shawkah illā quṣṣa bihā min khaṭāyāhu aw kuffira bihā min khaṭāyāhu
Transliteration generated from the Arabic vowel marks
The full narration
A'isha said:No trouble comes to a believer even if it is the pricking of a thorn that it becomes (the means) whereby his sins are effaced or his sins are obliterated. Yazid says: He does not know which word 'Urwa said (whether he said Qussa or Kuffira)
Source
Ṣaḥīḥ Muslim · 6566
Ṣaḥīḥ