God is faithful; he will not let you be tempted beyond what you can bear. But when you are tempted, he will also provide a way out so that you can stand up under it. (1 Corinthians 10:13, NIV)
If you remain in close contact with God, you are more likely to sense when temptation is intruding.
When it comes, go immediately to God. Don’t toy with the desire. Resist the devil, and he will flee from you (James 4:7). Remain in God’s presence in complete trust, humbly worshiping Him. Tell Him your weaknesses and struggles, and lovingly ask for His help.
The world, the flesh, and the Devil wage so fierce and constant a war that unless we depend on God, we will be dragged down. But in Him we always find the help we need.
by Brother Lawrence and Ken Bible