"But if what I would not, that I do, it is no more I that do it, but sin which dwelleth in me." (ASV)
Some people think that to really be a Christian, you have to be perfect. You have to be better than everyone else. Fortunately for us, this is not remotely the case.
Striving for perfection, while it is a noble pursuit, is not actually possible while we are here on this earth. We live in a culture ruled by sin, in bodies corrupted by it. While it is certainly possible to make headway in the war against sin, it is not possible for the human to actually win it.
So if we can't win, should we just give up? Not at all! You see our striving to be pure is glorifying to God. He desires our best. He delights when we turn to Him and ask for the strength to withstand temptation. He rejoices when we realize that we need His presence in our lives. And He is still working toward our perfection: "being confident of this very thing, that he who began a good work in you will perfect it until the day of Jesus Christ" (Philippians 1:6 ASV)
Still, when we strive to do right and fail, it hurts. But we can take heart, knowing that God has already provided a means for our justification: "My little children, these things write I unto you that ye may not sin. And if any man sin, we have an Advocate with the Father, Jesus Christ the righteous" (1 John 2:1 ASV)