And something very important for beating temptations is:
Stay away from the temptations
In example, we must know and remember that we are mos tempted when we are alone, so we must avoid to be alone as much as possible. That is a good reason to go to the church, we get encouraged when we meet out brothers and speak about God's word.
May God shine on you and guide you.