Sahih Muslim #2602 c, d
The Book of Virtue, Enjoining Good Manners, and Joining of the Ties of Kinship 45:123
Jabir b. Abdullah reported Allah's Messenger (ﷺ) as saying:
I am a human being and I have made this term with my Lord, the Exalted and Glorious: For any servant amongst Muslims whom I curse or scold, make that a source of purity and reward. This hadith has been narrated on the authority of Ibn Juraij with the same chain of transmitters.