Walking in the spirit. That's the key to overcoming the flesh. If you follow the prompting of the Spirit of God within you, you won't be dominated by the pressure your flesh tries to put on you.
As you listen to the written Word and the Holy Spirit telling you what to do, you'll constantly be making little adjustments in your life according to what He says. And those little adjustments will keep darkness from overtaking you.
You see, God knows just what you need. He can look ahead in your life and see the traps and pressures the devil is laying for you. So follow the Holy Spirit's leading and He will maneuver you safely around them to victory.