1 John 5:17 says, All unrighteousness is sin: and there is a sin not unto death. John said that all sin is unrighteousness, or failing to live by God's law. Though unrighteousness is about our failure to live up to God's law, not all sin leads to everlasting condemnation and separation from God. If we accept Jesus Christ as our Savior and Lord, all sin can be forgiven. The one sin that cannot be forgiven is not accepting His gift of salvation.
Verse eighteen adds, We know that whosoever is born of God sinneth not; but he that is begotten of God keepeth himself, and that wicked one toucheth him not. John tells us that if we are born of God, or spiritually reborn, that we do not sin but keep ourselves from the wicked one who cannot touch a born-again believer. I don't believe this means that Christians never sin again, but that we have the power by the Holy Spirit to never sin again and that Satan has no power over us unless we allow him to.
Verse nineteen continues, And we know that we are of God, and the whole world lieth in wickedness. John says that if we know we are of God, or have accepted Jesus Christ as our Savior and Lord, we know that the whole lost, or unredeemed world is guided by wickedness if they haven't accepted Him. By the power of the Holy Spirit, we must live righteously in an unrighteous world as followers of Christ.
Verse twenty states, And we know that the Son of God is come, and hath given us an understanding, that we may know him that is true, and we are in him that is true, even in his Son Jesus Christ. This is the true God, and eternal life. John said that Christians know the Son of God had come and had given us an understanding of what it means to be righteous in God's sight and that it is by putting our faith in Jesus Christ. There is no other way to be saved.
Verse twenty-one adds, Little children, keep yourselves from idols. Amen. John then warns us to keep ourselves from idols. Many things can be an idol, something that we put ahead of God, and not just statues. We may never be tempted to worship a statue, but we might make self-will or anything else an idol, if what we want becomes more important than what God calls us to do.