كتاب الأمور المنهي عنها
18
The Book of the Prohibited actions
Jarir bin 'Abdullah (May Allah be pleased with him) said:
I asked the Messenger of Allah (ﷺ) about (the Islamic ruling on) accidental glance (i.e., at a woman one is not Islamically allowed to look at) and he ordered me to turn my eyes away.

[Muslim].

وعن جرير رضي الله عنه قال‏:‏ سألت رسول الله صلى الله عليه وسلم عن نظر الفجأة فقال‏:‏ ‏ "‏اصرف بصرك‏"‏ ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏
Sunnah.com reference : Book 18, Hadith 115
Arabic/English book reference : Book 18, Hadith 1625