We are all tempted to think we can handle sin. In some areas of my life, I find myself trying to figure out how close to the edge I can go without actually sinning. Dumb I know, but common to us all.
There is better way.
A biblical approach is to keep to a path that leads us far away from our areas of weakness. For some it means no TV after 9pm, others it's Internet filters, others its ending a friendship. For me it has meant all of these and more.
Few of us are in situations like Joseph, he could not avoid Potiphar's wife and her lust for adultery (Gen 39v12) and he paid the price.
Mostly, we can choose to avoid the paths and doors that will lead us to sin and it's inevitable damage & pain - so let's make wise choices.