So often we are told to stop sinning, to change the way we act and follow Gods way.
How do we do that? Can we just decide to 'resist the devil' and that's it?
God knows we can't do it on our own - instead of just saying to resist the devil he says;
Submit yourselves, then, to God. Resist the devil, and he will flee from you. Come near to God and he will come near to you. James 4:7-8
It is only by drawing near to God that we can be changed. It is only by spending time with Him, reading his word and talking with Him that we can become renewed. God doesn't expect us to do it on our own.
So when you feel tempted, instead of spending all your energy focused on resisting the temptation, instead draw near to God, He will draw near to you and you will be able to become more like Him.