The beauty of living under grace through Christ's redemptive work on the cross means that we can now, for the first time in our lives, say no to sin. Think about that. Before we came to Christ, there's no way we could have said no to sin. Paul tells us in Ephesians that we were dead in our transgressions (sin). We could do nothing about our sinful condition. We were slaves to its desires. But the good news is the God has brought us from death unto life. We have been made new. We now have the ability to do what James calls resisting the devil. This is something we could not have done before Jesus came into our lives. We have been set free from the bondage of sin and its desires.
Does this mean we no longer have a desire to sin? Of course not. We all have a sinful nature that is just waiting for opportunities to creep its ugly head. What this does mean is that we now have the power in Jesus' name to say no. Sin has lost it's power over us. We don't have to sin. We sin because we choose to.
The Bible says that even when we are tempted He will provide a way of escape. The only response to sin and temptation that has ever worked in scripture is running away as fast as you can from the thing that is tempting you. Joseph was tempted and he ran out of the house so fast that he left his coat behind. His purity meant more to him than any earthly thing. He says that he could not do such a wicked thing against his God. Instead of weighing the options and letting the temptation eat at him, he flees. David, on the other hand, does not flee. He entertains the thought and lets it consume him. Once David opened the door to sin, its consequences came to stay like a house guest that won't leave. Samson flirted with his fleshly desires and it ultimately cost him his life.
The only response to sin is flight. Get out while you still can. God has provided a brief window of opportunity to say no and be victorious over sin's desires. We don't have to sin any longer.