"My little children, I am writing these things to you so that you may not sin. But if anyone does sin, we have an advocate before the Father- Jesus Christ, the Righteous One."
What John is writing here is that we, as Christians and as humans have been given all the instruction we need to live a life that is holy, blameless, and sin free. God hasn't hidden anything from us in regard to what sin is or isn't. So we can go an hour, or a day, or a week, or a month, or a year, or a lifetime without sinning. It is possible. "I AM WRITING THESE THINGS TO YOU SO THAT YOU MAY NOT SIN." However, we know that Jesus is the perfect One. The Righteous One. And He is the only human who has lived a blameless, perfect life. The rest of us always have and always will sin at some point.
When that happens, don't beat yourself up. Don't go down a negative mental state of "woah is me...I'm no good...I'm incapable." No. Instead, turn to Jesus. Run to Him. Put Him back on and move forward with the knowledge that in Christ you have power. And Jesus will walk alongside you and help you to live more like Him. Not in your own strength or power, but FROM JESUS.