That’s why you must do the next verse:
“…confess our sins, [and] he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness.” (1 John 1:9)
And then you fulfill this scripture if you obey unto righteousness (Romans 6:16):
“Everyone who has been born of God does not commit sin… and he cannot sin, because he has been born of God.” (1 John 3:9)
You missed the earlier verse on 1 John 1:But if we walk in the light, as he is in the light, we have fellowship with one another, and the blood of Jesus his Son
cleanses us from all sin.
1 John 1 is teaching about repentance to people being brought the gospel. Which is why it is telling them, if they say they have no sin, when the ones hearing the gospel may think repentance doesn't apply to them because they have no sin.
What it is not is the redeemed in Christ have sin in them.
If that were true Jesus then did not cleanse us from all unrighteousness.
This chapter also refutes those who blaspheme the holy spirit in saying Jesus/God had a sin nature.
Walking in the Light
1John 1: 5 This is the message we have heard from him and proclaim to you, that
God is light, and in him is no darkness at all. 6 If we say we have fellowship with him while we walk in darkness, we lie and do not practice the truth. 7 But if we walk in the light, as he is in the light, we have fellowship with one another, and the blood of Jesus his Son
cleanses us from all sin. 8 If we say we have no sin, we deceive ourselves, and the truth is not in us. 9 If we confess our sins, he is faithful and just to forgive us our sins and to cleanse us from all unrighteousness. 10 If we say we have not sinned, we make him a liar, and his word is not in us.
When we are redeemed from sin,saved, we are cleansed from all unrighteousness.
If someone thinks we have to repent perpetually everytime we sin after that or we're not saved from sin, then we're calling Jesus false because that would mean we are not cleansed from
all unrighteousness if we can become unrighteous again.
1 John 1 ESV