The Prophet ﷺ said, "Allah feels protective jealousy, and Allah's protective jealousy is that a believer should commit what Allah has forbidden."
عن النبي ﷺ قال: إن الله يغار، وغيرة الله أن يأتي المؤمن ما حرم الله.
Bukhari related it in the Book of Marriage (5223), and Muslim in the Book of Repentance (2761), both of them through Yahya, from Abu Salama, that he heard Abu Hurairah, from the Prophet ﷺ, saying what has already been mentioned, and the wording is Bukhari's.Muslim added, after the words "Allah feels jealousy," the phrase "and the believer feels jealousy."