Actually, I wouldn't go to chapter 2 for context. Chapter 2 verse 1 points back to what was already said, then Johns clarifies in the rest of the letter. He says
"I am writing these things to you so that you may not sin."
1Jn 1:1 That which was from the beginning, which we have heard, which we have seen with our eyes, which we looked upon and have touched with our hands, concerning the word of life--
1Jn 1:2 the life was made manifest, and we have seen it, and testify to it and proclaim to you the eternal life, which was with the Father and was made manifest to us--
1Jn 1:3 that which we have seen and heard we proclaim also to you, so that you too may have fellowship with us; and indeed our fellowship is with the Father and with his Son Jesus Christ.
1Jn 1:4 And we are writing these things so that our joy may be complete.
1Jn 1:5 This is the message we have heard from him and proclaim to you,.............
The message from the beginning, from Jesus himself, found in the gospels. The message John heard was
............that God is light, and in him is no darkness at all.
1Jn 1:6 If we say we have fellowship with him while we walk in darkness, we lie and do not practice the truth.
1Jn 1: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.
1Jn 1:8 If we say we have no sin, we deceive ourselves, and the truth is not in us.
1Jn 1:9 If we confess our sins, he is faithful and just to forgive us our sins and to cleanse us from all unrighteousness.
1Jn 1:10 If we say we have not sinned, we make him a liar, and his word is not in us.
Apparently Jesus himself said
If we say we have no sin, we deceive ourselves, and the truth is not in us.
So you have to ask yourself where Jesus said that, don't you?
and if this is what it says then why would we say John was saying we have to sin, then he turned around and said sin not and those born of God do not sin?
John wrote what Jesus taught
"If we say we have fellowship with him while we walk in darkness, we lie and do not practice the truth. 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."
in hopes it would make them stop sinning. A church seduced
1Jn 2:26 These things have I written unto you concerning them that seduce you.
Seduced with gnosticism -they could continue in sin. Read 2:2-25. They are the things written concerning their seduction.
Read 1Jo:5-10 then what Jesus taught
Joh 1:5 The light shines in the darkness, and the darkness has not overcome it.
Joh 3:19 And this is the judgment: the light has come into the world, and people loved the darkness rather than the light because their works were evil.
Joh 3:20 For everyone who does wicked things hates the light and does not come to the light, lest his works should be exposed.
Joh 3:21 But whoever does what is true comes to the light, so that it may be clearly seen that his works have been carried out in God."
Joh 5:38 and you do not have his word abiding in you, for you do not believe the one whom he has sent.
Joh 5:39 You search the Scriptures because you think that in them you have eternal life; and it is they that bear witness about me,
Joh 5:40 yet you refuse to come to me that you may have life.
Joh 5:42 But I know that you do not have the love of God within you.
Joh 5:47 But if you do not believe his writings, how will you believe my words?"
Joh 8:7 And as they continued to ask him, he stood up and said to them, "Let him who is without sin among you be the first to throw a stone at her."
Joh 8:12 Again Jesus spoke to them, saying, "I am the light of the world. Whoever follows me will not walk in darkness, but will have the light of life."
Joh 8:37 I know that you are offspring of Abraham; yet you seek to kill me because my word finds no place in you.
Joh 8:44 You are of your father the devil, and your will is to do your father's desires. He was a murderer from the beginning, and has nothing to do with the truth, because there is no truth in him. When he lies, he speaks out of his own character, for he is a liar and the father of lies.
Joh 8:46 Which one of you convicts me of sin? If I tell the truth, why do you not believe me?
Joh 8:47 Whoever is of God hears the words of God. The reason why you do not hear them is that you are not of God."
Joh 12:46 I have come into the world as light, so that whoever believes in me may not remain in darkness.
As a side. Compare
Joh 14:17 Even the Spirit of truth; whom the world cannot receive, because it seeth him not, neither knoweth him: but ye know him; for he dwelleth with you, and shall be in you.
1Jn 2:21 I have not written unto you because ye know not the truth, but because ye know it, and that no lie is of the truth.
1Jn 2:22 Who is a liar but he that denieth that Jesus is the Christ? He is antichrist, that denieth the Father and the Son.
1Jn 2:27 But the anointing which ye have received of him abideth in you, and ye need not that any man teach you: but as the same anointing teacheth you of all things, and is truth, and is no lie, and even as it hath taught you, ye shall abide in him.
Joh 8:31 So Jesus said to the Jews who had believed in him, "If you abide in my word, you are truly my disciples,
1Jn 2:24 Let what you heard from the beginning abide in you. If what you heard from the beginning abides in you, then you too will abide in the Son and in the Father.
It's fascinating to compare the two books. This is not a thorough comparison.
John wasn't telling believers they all sin and if they think they don't they are deceiving themselves and the truth is not in them. Jesus came in the beginning and his message was all have sin. No one can cast a stone. Those that confess will be forgiven and have eternal life. This is what John heard and proclaimed in the letter. He's talking to a confused, seduced church, telling them what Jesus told him, so that they may "have joy", "sin not" and "know they have eternal life" because some have been seduced with gnosticism.
The last time he said why he wrote to them.
1Jn 5:13 I write these things to you who believe in the name of the Son of God that you may know that you have eternal life.
How can you know? What did John write?
1Jn 5:4 For everyone who has been born of God overcomes the world. And this is the victory that has overcome the world--our faith.
1Jn 5:5 Who is it that overcomes the world except the one who believes that Jesus is the Son of God?