In the Flight to Freedom program, we teach basic strategies for shmiras einayim. If those don't work for you, here are some advanced ones:
The 3-Second Rule
The 3-second rule is a twist on the one-second rule described in the video. Once you've recognized that you've unexpectedly seen an attractive person in the street, do the following:
1st second: Acknowledge that you've seen a person whom you find attractive and arousing. Feeling sexual attraction is, after all, a normal aspect of being human and nothing to be ashamed of.
2nd second: Look away. Look at something else other than the thing you find arousing. Acknowledge that you are struggling not to keep staring at the person and with your thoughts of acting out. Accept your feelings, but rather than acting on them, choose to do the opposite and look away.
3rd second: Once you've averted your eyes, realize that this person is someone's daughter, sister, niece, and so on. Recognize that they are a real person who you have no right to use as material for your sexual fantasies, then move on.
In accepting your feelings, turning away and choosing not to objectify the person, you won't become lost in the fantasy. You'll continue to feel okay as someone with healthy sexual desires who isn't held hostage by their urges or compelled to act them out. You'll be able to feel like someone who sees others as human like you and not as objects. The more you engage in this simple strategy, the less temptation you'll experience.
Reassess the Situation
Remind yourself that the attractive person is not an object but a genuine person with feelings who has parents or children who care about them. Think about what they may be feeling right now (perhaps they feel sad or unwell) or the difficult experiences they might've gone through in their life. They are not objects to be compared with another object or judged on their shape or proportions. They aren't a picture for you to store in your memory bank and use as a sexual fantasy. For instance, if you're a father, think about how bad you'd feel to know that someone is thinking impure thoughts about your daughter.
Pray for the Person
This strategy goes a little step further. Pray for the person you've made the object of your desire by asking God to protect them and their loved ones. Praying for the person places them in a relational context and de-objectifies them. Below is a prayer that may help dispel this kind of fantasy, or the "bubble" of temptation, before it completely envelops you. It can free your mind from these unhealthy thoughts and help you to feel less trapped by them:
In the Words of Dov, "If I'm unable to ignore my thoughts, I make sure to try and do the diametric opposite of whatever my lust is: Meaning, instead of worshipping or sexually devouring the person or image or whatever, I pause and pray (with actual spoken words, in private) for the person or institution involved me'umka deliba (from the depth of my heart) as best I am able right then. Not for them to 'finally see the light and stop being so provocative or promiscuous` - that judgmentalism poisons me no matter how much my morality agrees with it. It is more than useless. That would be prayer for YOU, not for HER. Rather, I daven that Hashem (G-d) should give them health and comfort in this life and whatever is afterward, and that He grant them a progressive awareness of Him and of all the good in their lives, and that He give them clarity in how all the good in their lives comes from Him, and that he even grants them acceptance that all the hard times they may have in their long futures is a gift from Him somehow, and that they also have peace of mind to really do right by themselves and by G-d. Then I may ask for all the same for me: Health, Comfort, Progressive awareness of Him in my life, and Peace of mind. "
When done right, this strategy works every single time. But Dov makes it clear this option should be used as a last resort.
"My 'First Aid' when I feel temptation to look at someone or something is to smile and close my eyes. I then move on with my job, my shopping, my driving, whatever it is that I was doing. I tried to reconnect with the present, real life, after that brief distraction.
"If that doesn't work - and in the beginning of recovery it often doesn't - I stop again. I try to take it easy and remember that I'm in G-d's Hands, always was, and will remain in His Good Care long after the person I want to see is old and shriveled (and I am too!). I quickly remind myself that it's just a fact that I can't successfully use this image any more than I can fly across the Grand Canyon or lay an egg. So do I want to try again, or have I had enough?
"When my 'First Aid' does not seem to be working after a couple of minutes (if I have that long), I usually try the 'bigger gun' of praying for the person I'm still wanting to check out. I have found that's a terrible thing to do as First Aid. I have seen over, and over again that praying for the person we are lusting after becomes a tool to keep them in our minds and hearts for as long as possible. And when it fails, it usually then fails badly. So I keep it back, the way I would a firearm. Last resort.
"And then, I pray to G-d to help me with the pain I'm going to feel after giving up that sweet opportunity. Even though my nice, recovering mind doesn't like to admit it was a sweet opportunity...it undoubtedly was. So I ask for help, smile again, and move on with reality."
That said, it is okay to use this strategy as 'First Aid', if you keep the prayer very brief. For example, you can look away, and then simply say 'May Hashem Bless Her.' Or just say a short Kapitel of Tehillim for her.
When You Can't Look Away
The tools we've just described can also help when it's impractical to look away from someone. For example, when you need to speak to them. It's essential to reassess the situation during these times and remind yourself that the person before you is also human. Tell yourself that "This person has feelings and is just trying to go about their day like I am. They aren't interested in a sexual relationship with me and are not here for my pleasure." Then place all your attention on the conversation and what the person has to say.