We all struggle with sin and temptation in our lives. Satan even tempted Jesus, but was of course, unsuccessful in convincing him to sin.
My experience has been that I need to be very very careful what goes through my mind. I am very selective about what materials I read, music I listen to, and just to be honest, I quit watching television almost 4 years ago. It was just so full of garbage I couldn't get to the remote control fast enough.
You may think I am strict on myself, and yes, you may be right, but we are supposed to guard our hearts.
If you can recognize satan as he begins to talk to you, you have half the battle won. Problem is, with most of us, we think it is our own thought, and we don't spot him quickly enough. Pay attention when you are being tempted. Pay attention to where you are and what is going on when these thoughts come to you.
The Bible says "Submit yourself to God, resist the devil, and he will flee." What a promise, we don't run from satan, HE RUNS FROM US. :) The very first part of that verse is so important though. Are we fulling submitted to God? If we are, then we RESIST, and then we are promised that satan will flee.
The very best thing we can all do, is read the Word of God everyday. Proverbs is especially good at times.