Here is the structure for I John 1:5-2:2, which form one unit of thought. John give us three different if-then statements that expose a false claim. All three are followed by the correction to that false claim, as well as pointing us to Jesus Christ and his sacrifice on the cross. In these verses John expresses some glorious gospel truths with a wonderful literary structure. I end each section with a paraphrase.
False Claim #1 (I John 1:6-7)
If we say that we have fellowship with God, but walk in darkness
We lie and do not do the truth
We cannot live a life dominated by sin and still claim to be saved.
If we walk in the light as he is in the light.
We have fellowship with one another
Jesus cleanses us from all sin.
A life dominated by righteousness will be seen by our fellowship with one another and with Christ.
False Claim #2 (I John 1:8-9)
If we say that we do not have sin
We deceive ourselves and the truth is not in us
A claim to be without sin (or possibly without a sin nature) will cause us to live in a fantasy land. We will be living a lie.
If we confess our sins
He is faithful and just to forgive us our sins and cleanse us from all unrighteousness
Regular confession of sin is one of the antidotes to believing ourselves sinless. We can confess our sins with confidence because God has promised to forgive us.
False Claim #3 (I John 1:10-2:2)
If we say that we have not sinned
We make him a liar and his word is not in us.
A claim to be without sin blasphemes God and shows that his word does not live in us.
These things I write so you might not sin
If anyone might sin
We have an advocate with the Father Jesus Christ the righteous
and He is the propitiation for our sins and the sins of the whole world.
We are to strive to be without sin. The previous verses (I John 1:5-10) are not meant to encourage loose living. However, we will sin and when we do we have a present righteous intercessor whose past blood-sacrifice covers all of our sins.