Can we benefit from our failures? Sure! Disgust over failure helps prod us toward the goal of resisting sin. Obviously we’ll never be sinless, but that mustn’t keep us from fleeing from temptation. God is here to help, and things will get better each time you make the right choice. You must never allow sin to become an excuse for retreating from God. Let your sin drive you to Jesus rather than away from Him. Run to Him with it!
God knows and understands you. And He’s more than willing to work with a repentant heart. Satan leads you to believe that you can’t come back to God until you’ve cleaned up your act. But the cross has stripped him of any power to separate you from God. So you must never allow him to fool you into thinking that sin somehow puts up a barrier between you and Jesus.
From Free from the Power of Sin: the Keys to Growing in God in Spite of Yourself