LINK
It allows us to recognize that genuine feeling of guilt, this is a gift, a privilege to avoid the suffering that comes as a result of sin.
If we say that we have fellowship with him, and we walk in darkness, we lie, and do not practice the truth; 7 But if we walk in the light, as he is in the light, we have fellowship with one another, and the blood of Jesus Christ his Son cleanses us from all sin. 8 If we say that we have no sin, we deceive ourselves, and the truth is not in us. 9 If we confess our sins, he is faithful and just to forgive us our sins and cleanse us from all unrighteousness. 10 If we say that we have not sinned, we make him a liar, and his word is not in us.
1 John 1:6-10