Resist with the Word of truth
Hebrews 4:12 says God's Word is living and active. Did you know you can carry a weapon that will make your thoughts obey Jesus Christ? If you don't believe me, read 2 Corinthians 10:4-5 One of these weapons is the Word of God.
Though it can be helpful to read God's Word when you're being tempted, sometimes that's not practical. Even better is to practice reading the Word daily, so that eventually you have so much of it inside, you are ready whenever temptation comes. If you are reading through the Bible regularly, you will have the full counsel of God at your disposal.