I asked the Messenger of Allah ﷺ about an unintentional glance, and he instructed me to turn my gaze away.
سألت رسول الله ﷺ عن نظر الفجاءة فأمرني أن أصرف بصري.
Muslim reported it in the Book of Manners (2159) through multiple routes from Yunus, from Amr bin Saeed, from Abu Zura, from Jareer bin Abdullah, who mentioned it.