All books of the Bible are written for believers, none are written for unbelievers. Of course some unbelievers have been converted by reading the Bible - that happened to me. Some unbelievers have read the Bible and remain unbelievers.
Anyway, the epistles of John were written to believers, so in reading 1 John 1, we know John is speaking to fellow Christians, so that is the starting point in getting the context correct in interpreting it.
John says that, as fellow disciples of Jesus, we can have fellowship with the Father and with His Son Jesus Christ. Verse 3
In verse 6, He warns believers that is they "walk in the darkness" and yet claim to be a Christian, they are lying. Walking in the darkness implies living a life-style of sin. Either they are a tare planted by Satan, or a believer who has fallen away from the Lord and has lost salvation or a deceived believer who still claims Jesus, but is careless about abiding in Him - becoming friendly with the world and forsaking fellowship with other believers and not walking in a holy manner. I believe that all three of these conditions are not necessarily hopeless. They can repent and come back to Jesus.
By contrast, John, in verse 7 speaks of believers who are walking in the Light, living their lives in a holy way. They have fellowship with other believers and with the Father and the Son- but John surprisingly says that the blood of Jesus will cleanse them from all sin. We are surprised to hear that they need to be cleansed of all sin. We know they were cleansed of sin when they first got saved. But now they are walking in the light, living a life-style of righteousness, yet John says they still need, at times, to be cleansed from their sins.
In verse 8, John continues to speak to those who are walking in the Light, but who say, "I don't have any sin - Jesus already forgave me back when I was saved." John says these Christians are deceiving themselves and the truth is not in them.
In verse 9, he continues to speak to the same group and says that if they confess their sins, God is faithful and righteous to forgive their sins and to cleanse them from all unrighteousness. If they stubbornly continue to insist that they have not sinned, they make God a liar and His word is not in them.
Believers will never reach a place where they no longer sin on this earth. This is why Jesus washed His disciples' feet. Jesus said, "He who has bathed (that is, gotten saved) needs only to wash his feet, but is completely clean." (that is, to confess their sins and allow the blood of Jesus to cleanses them from all unrighteousness).
Jesus recognized that as we walk through this sinful, dark world, we cannot avoid getting our feet dirty - that is, we will sin. We must allow Jesus to "wash our feet" and cleanse us from any current sins. If we say, like Peter, "Lord, NEVER shall you wash my feet!" Jesus will answer us, "If I do not wash you, you have no part with Me."
If we do not allow Jesus to wash us of our current and sometimes daily sins, we will have no part with Him.
Just because we still sin at times, does not mean that we are not walking in the Light. But we must deal with those sins, not ignore them, or say that we have no sins.