Avoiding temptation can be challenging, but there are several things you can do to help resist temptation. Which is we should have faith to ourselves and to God. Remember all the commandments of God every time you can encounter temptations.
Temptation is a normal part of our life, and everyone faces it in one way or other. Ask God for the strength to resist temptation and for the wisdom to make wise choices.