The Prophet ﷺ said, "Allah has decreed for the son of Adam his share of fornication, which he will inevitably encounter. The fornication of the eye is the look, the fornication of the tongue is speech, the soul wishes and desires, and the private parts either confirm all that or deny it."
قال النبي ﷺ: إن الله كتب على ابن آدم حظه من الزنا، أدرك ذلك لا محالة، فزنا العين النظر، وزنا اللسان المنطق، والنفس تمني وتشتهي، والفرج يصدق ذلك كله ويكذبه.
Bukhari narrated it in the Book of Seeking Permission (6243) and Muslim in the Book of Divine Decree (2657), both from the hadith of Abdul-Razzaq, who said, Maamar informed us, from Ibn Tawus, from his father, from Ibn Abbas, who said, "I have not seen anything closer to lamam than what Abu Hurairah said, from the Prophet ﷺ," then he mentioned the hadith.