The Messenger of Allah ﷺ said, "Allah feels protective jealousy, and the believer feels protective jealousy. Allah's protective jealousy is when a believer commits what He has forbidden him."
قال رسول الله ﷺ: إن الله يغار، وإن المؤمن يغار، وغيرة الله أن يأتي المؤمن ما حرم عليه.
Bukhari narrated it in the Book of Marriage (5223), and Muslim in the Book of Repentance (2761), both from the hadith of Yahya, who said, "Abu Salama narrated to me, from Abu Hurairah," and he related it.On this topic there are other hadiths mentioned in the Book of Faith.