"If we say that we have no sin, we deceive ourselves, and the truth is not in us. If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness. If we say that we have not sinned, we make him a liar, and his word is not in us (1 John 1:8-10). My little children, these things write I unto you, that ye sin not. And if any man sin, we have an advocate with the Father, Jesus Christ the righteous: And he is the propitiation for our sins: and not for ours only, but also for the sins of the whole world (1 John 2:1-2).
We All Sin. Thankfully We [Believers] Have An Advocate
Because of Adam disobeying God in the Garden of Eden, we all are natural born sinners who arbitrarily practice sin. Thankfully, we [believers] have an advocate. "For God so [greatly] loved and dearly prized the world, that He [even] gave His [One and] only begotten Son [Jesus], so that whoever believes and trusts in Him [as Savior] shall not perish, but have eternal life (John 3:16). Jesus is our advocate. He is our defense from God's wrath against sin. His Crucifixion on the Cross pardons past, present, and future sins of all who believe and put their trust in Him. Although our sins are forgiven, we still have the tendency to sin which is why we confess them. Yes God knows our thoughts (Psalm 139:4). We don't confess our sins to gain His acceptance, He has already accepted us upon conversion, we do it to remove barriers to our fellowship with Him.
Confession Involves A Commitment
We confess our sins to God in order to remove all barriers between us and our fellowship with Him so not to deceive ourselves, or try to deceive God. When we confess we are telling God that we need His strength and Power to help us overcome the temptation to sin. One needs to be committed to his relationship with God in order to avoid being tempted to sin. One must develop a strong prayer life with God, because He is the One Who will make a way out of tempting situations. God will not let you be tempted beyond what you can bear (1 Corinthians 10:13).
Jesus Christ Is Our Advocate