Can Christians sin? Apparently yes, according to 2:1 and 5:16. However, notice that in both these verses, a Christian's sin is not unto death. The penalty for sin is death. What we deserve for sinning is death, and our sin would be unto death if it were not for the Christ's propitiation in our place. "The wages of sin is death, but the gift of God is eternal life through Jesus Christ our Lord." (Rom. 6:23) So the fact that we as Christians can sin and yet it is not unto death (we don't get what we deserve; we are not condemned for it) is because "we have an advocate with the Father, Jesus Christ the righteous, and He is the propitiation for our sins..." (2:1-2) Christ died for us and bore our iniquities, taking away our sins, so that now the Father looks upon us as perfectly blameless and righteous. Just as sin brings death, righteousness brings life, and in 1 John 5:11-12 John writes: "And this is the record, that God has given to us eternal life, and this life is in His Son. He that has the Son has life, and he that has not the Son of God has not life." If you believe, then you have the Son, and therefore life through the Son (5:13). Obviously these words are loaded with meaning, and are all connected to the great themes of the cross. I have life because I have the Son who died for my sins. So therefore, based upon all of this, if a Christian sins, it is not unto death.
However, John takes this truth and speaks about it from another angle. Yes, we sin as Christians, but we have an advocate with the Father... our sins are not unto death because Christ died in our place and took our sins away... God now sees us as blameless and righteous in Christ, and through that righteousness we have eternal life: therefore, another way to look at all this is that "a Christian cannot commit sin" (3:9) from the true and heavenly perspective. God does not lay any charge against His saints. If a person can commit sin - that is, if God counts a sin against him - then he cannot be a Christian, because then he would be under the sentence of death. This would prove that he is not in the Son. So in 3:4-9 John is speaking from a loftier top-down perspective rather than the more common man-to-man perspective of 2:1 and 5:16-17. This very same heavenly perspective looks and sees that we believers are "as righteous as He is righteous" (3:7). This is clearly not talking about our works as Christians, but our objective justification before God. God sees us as perfectly blameless and righteous, and John says so as well here. It is from this perspective that he is seeing that we do not sin/are righteous.
John defines sin in 3:4 as "transgression of the law" or "lawlessness", thus giving us a guide for the passage. Substitute the word "sin" in this passage for "transgressing the law". "Whoever is born of God cannot break the law", or "be lawless". It is impossible for two reasons: 1) a Christian is no longer in the flesh, under the law, and is not being judged by his legal performance - he therefore cannot break the law. His relationship to God is not based on law. He is dead to law, and cannot break what he is not obligated to obey. 2) The Christian, while not justified by law nor under the law, is fully lawful in Christ: that through faith in Christ the law has not been set aside and made void but is established (Rom. 3:31). Christ died so that "the righteousness of the law might be fulfilled in us" (Rom. 8:4), who do not seek to be righteous by the law, but through faith in Jesus Christ, who makes us lawful "apart from law" (Rom. 3:21). That is an amazing thing! I am not under the law or judged by it, but in Christ I am perfectly lawful. If a person is not righteous and lawful in Christ, but rather is under the law, and his righteousness depends upon his obedience to the law by his own works, he therefore cannot be "righteous as Christ is righteous", and is thus a sinner. God counts his sins against him, for he is being judged by the law, proving that he is not born of God.
John is really quite simple: "You know that He was manifested to take away our sins, and in Him is no sin. Whoever abides in Him sins not." (3:5-6) We "sin not" by virtue of being in Him, who Himself is sinless (we are sinless in Him), and who died for our sins, taking our sins away. This is John's point in 5:18 also.
Most commentators do not see the simple mystery of the 3:4-9 passage, and therefore have great difficultly trying to explain and reconcile this passage with the rest of the New Testament. The common explanation is that John is talking about "habitual" or "practicing" sin... not just an act of sin, but a lifestyle. This is an idea that is forced upon the passage in an attempt to soften the difficulty of it. There is absolutely no warrant in the Greek to interpret it this way. It is usually noted that John uses the present tense, and based upon this they say that it means ongoing or habitual. But the present tense could also just mean that you presently and constantly do not commit an act of sin. Commentators are totally inconsistent about this point, because all throughout the New Testament where the present tense is used in other verses they almost never interpret it as habitual. For example, take 1 John 3:4: "Whoever commits sin transgresses the law." How do commentators interpret the present tense "commit sin" here, and this concept elsewhere in the Bible? Answer: one single sin causes you to be a lawbreaker/lawless (see James 2:10). It makes no sense Biblically to say that only habitual sin breaks the law... otherwise we would not be lawbreakers if we sinned once or twice, and we could make the case that we are righteous by our works... habitual goodness, not perfect goodness. In fact, that is exactly what Jews, Muslims and Mormons do - they argue that they are righteous even though they aren't perfect, because they are mostly, habitually good. But the Bible teaches us everywhere, and here in 1 John, that righteousness is absolute moral perfection, and that this is the law's standard. We must not bend Scripture; we must seek to understand Scripture, and I believe that John's point is made clear when we see that he is speaking about the simple mystery of our righteous/sinless identity in Jesus Christ (another perspective from the heavenlies).
As for 1 John 5:21, it is the most perfect way to close a letter that is all about knowing God the Father through Jesus Christ. It is through Christ that we come to understand who God is: a God of grace (John 1:14-18). This is known by seeing that Christ is the revelation of the Father, and that Christ was crucified for our sins. The death of Christ reveals the amazing love of God for us sinners. That love is the ultimate attribute - the essence - of God. "God is love." (4:16) It is not contentless love, but propitiatory love (4:9-10). To know the Father through Christ is to know God. To know all sorts of true things about God but to not know Him as the gracious Father through Christ is to not know God at all (see for example, John 16:2-3), and therefore to not be born of God (Gal. 4:6)
Thus John writes: "And we know that the Son of God has come, and has given us an understanding, that we may know Him that is true, and we are in Him that is true, and in His Son Jesus Christ. This is the true God, and eternal life." (1 John 5:20). In the light of this, he finishes: "Little children, keep yourselves from idols." (5:21) That is, keep yourselves from any conception of God other than the revelation of the Father through the Son. Don't let anyone deceive you away from the truth. Any God other than this is an idol, not the real God, but a false god. No matter how many true things one might believe about God, if one does not know God through Jesus Christ crucified, one does not know God at all, but is an idolator.
"You neither know me, nor my Father: if you had known me, you would have known my Father also." (John 18:19)
"The ox knows his owner... but Israel does not know, my people do not consider." (Isaiah 1:3)
And the whole point of the New Covenant:
"And they shall teach no more every man his neighbor, and every man his brother, saying, 'Know the Lord': for they shall all know me, from the least of them unto the greatest of them, says the Lord: for I will forgive their iniquity, and remember their sin no more." (Jer. 31:34)
The knowledge of God is based upon the forgiveness of sins.
Christianity is all about knowing God the Father through Jesus Christ. Therefore, "keep yourselves from idols" is the perfect way to close 1 John.