Being forgiven by God is part and parcel of what it means to be justified (Ac 13:38-39) or saved (Ro 5:9), to be His child. If we die with any sin which isn’t forgiven by God, which is not washed away by the blood of Christ (Re 1:5), the consequence is spiritual death (Ez 18:4), separation from God forever in Hell. (Ro 6:23) So, it’s vital to ensure that all our sins are forgiven, every last one of them. (Co 2:13)
If we make forgiveness of our sin conditional upon our behavior, then by definition this behavior becomes a means of earning or maintaining salvation, since if we don’t faithfully engage in this behavior we’re lost forever. This is effectively salvation by works, or legalism, which the Scripture rejects as inconsistent with the Gospel: we’re justified by faith (Ro 3:28), not by works. (Ga 5:4)
Salvation produces behavior in the believer reflecting the divine nature; we become new creatures (2Co 5:17), moving away from sin to walk with God. This is an ongoing process where we are growing over time, so no believer is perfectly sinless this side of Heaven (Ro 7:21); we continue to sin in ways we hardly even comprehend (1Jn 1:8), but we don’t commit ourselves to a life of willful, presumptuous sin. (1Jn 3:8-10)
As believers, once we realize we’ve sinned we acknowledge this before God; we confess our sin, agreeing with God about it, and look to Him to help us, knowing He is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness. (1Jn 1:9) He doesn’t forgive us because we confess our sin, He forgives us because Jesus died for us and paid our sin debt once for all. (He 10:14)
If forgiveness were conditional on our confession, this would make confession a work required for justification, which cannot be. Confession is simply the natural response for believers whenever we become aware of our sin, and since we’re forgiven of all of our sin, past, present and future sins, we can rest assured we’re forgiven: He never even charges us with sin. (Ro 4:7-8) This is the only way we can be sure of our salvation. (Ro 7:16)
We may confirm this rigorously in the text of 1st John 1:9, which states: “If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness.” The text does not say, “If we don’t confess our sins, God will not forgive us.” This latter statement, which many infer from this verse, is called the Inverse and it’s not logically equivalent to the original (it means something different). To illustrate, I might say, “If it rains I will go to the store.” If it doesn’t rain and I do go to the store, I’m not being inconsistent; I didn’t say what I would do if it didn’t rain, only what I would do if it did rain. So, 1st John 1:9 says nothing about what God will do if we don’t confess a particular sin; it simply affirms that as we confess our sins we may be confident we’re forgiven.