Keeping things in perspective and just focusing on the here and now can be very challenging, especially because the Yetzer Hara keeps trying to tell us that there is no way we can beat him, and that its just a matter of time before we fall again.
One strategy which I have found to work for me may sound a bit infantile. Anytime that I avoid staring at a women, or navigate away from an inappropriate link on a webpage or stay away from an area where inappropriatly dressed women can be found,... I give myself a tally in a little notebook that I keep in my pocket. I promise myself that if I get 50 tallies, i.e. I withstand the Yetzer Harah just 50 times, no matter how long it takes me to get to 50, I'm going to treat myself to CD of my favorite Jewish music, or a sefer that I have wanted to buy for a long time. If I fall, it doesn't matter because I'm tallying my successes, and Mitzvos are never cancelled by Aveiros!
Eventually, I hit 50, buy myself that CD or sefer, and every time I learn the Sefer or listen to that CD, I'm reminded by the fact that I Hashem wants me to succeed and will help me to do so.
The next time, my goal is 75 tallies, and for some reason, the period of 75 goes by faster than it took to get to 50. Baruch Hashem, my goal is now 200, and B'ezras Hashem, I'll get their shortly.