“If anyone sins … he realizes his guilt … and confesses the sin” (v1-5). The Israelites were instructed that if they suddenly realized that they had sinned (by refusing to be a witness, or by making a rash promise, or by touching something dead, etc), the right thing to do was to immediately confess the sin and then go make an offering for atonement. The breaking of the law itself could not permanently destroy their relationship with God unless they hid their sin and pretended to be innocent.
“If anyone sins …” (v17). God is not surprised by our sins. He calls us to take responsibility, tell the truth, and reach out for His forgiveness (v17-18).