In order to "walk in the light," a person must confess sin to God and stop sinning (1:5–7; 9). John emphasizes sin in chapter 1 to encourage Christians to reject and avoid it.
if anyone does sin: Christians should reject sin, but they should not fear confessing sins to God.
advocate: The Greek word paraklētos means “one who is called to our side.” It can mean helper, comforter, or advocate (a person who speaks for us in a court). Christ is our advocate. He stands before the Father and speaks on our behalf (see Romans 8:26–34; compare John 14:16).
Jesus Christ, the Righteous One: We are sinful, but Christ is righteous. Because Christ obeyed the Father fully and offered himself for our sins, he can stand before God as the one who brings us forgiveness, healing, and restoration. When God raised Christ from the dead, it showed that God accepted Christ’s work and his plea for our acquittal once for all (see Romans 4:23–25). As the Protestant Reformer Martin Luther wrote, “The righteousness of Christ stands on our side; for God’s righteousness is, in Jesus Christ, ours.”