"If we claim to have fellowship with Him yet walk in darkness, we lie and do not live by the truth." (verse 6).
In other words, if someone says he has fellowship with Christ, but is walking in darkness (lost), he is lying and not practicing the truth. The Gnostics ( not true believers ) claimed to be in fellowship with Christ (saved), and yet were actually living a lie and therefore weren't practicing the truth.
"If we ( believers ) walk in the light, as He is in the light, we ( believers ) have fellowship with one another, and the blood of Jesus, His Son, purifies us ( believers ) from all sin" (verse 7).
In other words, if we walk in the light (are saved) we have fellowship with one another and the blood of Christ cleanses us from all sin. To put it another way, once we are saved, we are permanently in the fellowship because the blood of Jesus continually cleanses us from all sin. Therefore, we aren't forgiven because we confess our sins.We are forgiven because of what Christ did for us on the cross.
"If we ( John putting all of us in the same boat before coming to Christ ) claim to be without sin, we deceive ourselves and the truth is not in us" (verse 8).
John is now addressing the belief the Gnostics had regarding sin because they didn't believe it was real and therefore believed they had no sin. The "we" John is using here refers to all people before coming to Christ including all believers too which "we" had to acknowledge at some point in our lives. He is referring specifically to the Gnostics, who believed they were without sin. Because they claimed to be without sin, then they were only deceiving themselves and the truth (Jesus) was not in them.