The Prophet ﷺ said, "Allah has written for the son of Adam his share of fornication, which he will inevitably encounter. The fornication of the eyes 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 Isti'dhan, chapter "The zina of the limbs without the private part," no. 6243, and Muslim in Qadar, chapter "What was decreed for Ibn Adam of his share of zina and other than it," no. 2657, from the hadith of Mamar, transmitted by him.