Well, I would have two pieces of advice, tips if you will. 1) Turn from it at the onset. Distract yourself. Call a friend--not a friend of the opposite sex that you are attracted to, or not even one that you will discuss the temptation at hand with (though that's also a suggestion). However, just turning from it and chatting with someone about the weather will help. 2) Think about it logically. Remember what it feels like when you do screw up. Remember the guilt. Remember that it doesn't do what you think it will.
We are not tempted by anything except for what is common to man (or woman). You aren't alone. Confess it to a trusted friend or mentor. Confession allows truth to come in.