Sahih Muslim #2572 g
The Book of Virtue, Enjoining Good Manners, and Joining of the Ties of Kinship 45:65
'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.