The apostle John begins his first epistle by declaring that he was an eyewitness to Jesus’ earthly ministry. He explains that belief in Jesus leads to eternal life and fellowship with God, Jesus, and those who believe in Him. John then states without reservation that God is light and no darkness exists in Him at all. With this truth as a starting point, John draws a clear distinction between a life of light and one of darkness. He makes it clear that one cannot live a life of darkness and then say they believe in Jesus. This is a lie, plain and simple.
He also opposes any who say they have no sin or that they never sin. This is self-deception and in fact makes God a liar. But John also clearly states that when we do fall into sin and confess this to God, He forgives us and cleanses us of all our unrighteousness.