I recently read a pretty good article on just this topic on the Campaign for Core Christianity website:
"Whatever form it takes, we all know how messing up feels. First comes the realization regarding the mistake we made. Next may be someone finding out about it—along with the shame and embarrassment—and finally having to face the consequences of our mistake.For days afterwards, depression, anxiety, emotional and sometimes physical distress may dominate our lives. We replay the events over and over in our minds, and doubts about our self-worth and value can begin to creep in. In those moments, it is easy to think that maybe we should give up and quit the job, the marriage, the family, the friendship, or whatever will get us away from the situation.
These thoughts can also cause us to forget the gospel message. Or even if we remember it, it doesn’t necessarily take away the pain. Maybe we wonder, “Jesus died for my sins but I still mess up. I let people down or hurt someone or acted stupidly. How does Jesus’ death so long ago and so isolated from my life now bring me any comfort? I still messed up, and I still have to face that shame today.”
But this attitude shows a fundamental misunderstanding of what is really going on. The truth is that Jesus is the best comfort we can have when facing failure. In the midst of our failures and mistakes, it is vital that we remember these four crucial points Scripture tells us about reality."
Read the whole article here.