When training a dog if you put a piece of meat on the floor and tell what dog “no”. The dog knows that no means he cannot touch it. So he will take his eyes off the meat and look at his master.
When faced with temptation we need to take our eyes off the temptation and keep our eyes on the Master.
1 Corinthians 10:13 There hath no temptation taken you but such as is common to man: but God is faithful, who will not suffer you to be tempted above that ye are able; but will with the temptation also make a way to escape, that ye may be able to bear it.