Sahih Muslim 2601 e
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
اللَّهُمَّ إِنَّمَا مُحَمَّدٌ بَشَرٌ يَغْضَبُ كَمَا يَغْضَبُ الْبَشَرُ وَإِنِّي قَدِ اتَّخَذْتُ عِنْدَكَ عَهْدًا لَنْ تُخْلِفَنِيهِ فَأَيُّمَا مُؤْمِنٍ آذَيْتُهُ أَوْ سَبَبْتُهُ أَوْ جَلَدْتُهُ فَاجْعَلْهَا لَهُ كَفَّارَةً وَقُرْبَةً تُقَرِّبُهُ بِهَا إِلَيْكَ يَوْمَ الْقِيَامَةِ "
Salim, the freed slave of Nasriyyin, said:
I heard Abu Huraira as saying that he heard Allah's Messenger (ﷺ) as saying: O Allah, Muhammad is a human being. I lose my temper just as human beings lose temper, and I have held a covenant with You which You wouldst not break: For a believer whom I give any trouble or invoke curse or beat, make that an expiation (of his sins and a source of) his nearness to You on the Day of Resurrection.
Full reference and source
Sahih Muslim 2601 e In-book : Book 45, Hadith 120 USC-MSA web (English) : Book 32, Hadith 6293 (deprecated)
View source on Sunnah.com (opens in a new tab)