There are several good protections against temptations but the surest is cowardice.
It has been my experience that very little occurs in the way of transgression that is not first rehearsed and debated in one's own own mind. A key to avoiding these pitfalls is to let virtue guide our thoughts and deeds always, not allowing our minds to wander into places where they should not go.
The devil hath power To assume a pleasing shape.