Jarir said I asked the Apostle of Allaahﷺ about an accidental glance (on a woman). He ﷺ said "Turn your eyes away".
The Prophet Muhammad's advice here serves as an example for us today in how we should conduct ourselves in public and private settings alike. We should always strive for modesty and respectfulness when interacting with others, regardless if they are members of the same gender or not. Additionally, this hadith reminds us that even small actions can have a big impact on our lives; thus, we must always be mindful about what we do and say at all times so as not to cause harm or offense towards anyone else.