I have confessed my sins to God and repent and grieve over committing sins I fully knew were sins. I’ll admit He already knew them anyway. I can certainly understand confessing adultery to a spouse because he/she is the one sinned against. But what about other sins like abortion or pornography? Do you publicly tell your family members in order to confess?
After stealing Uriah’s wife (Bathsheba) and arranging for his death, David said to the Lord, “Against you and you only have I sinned.” (Psalm 51:4)
We may wrong other people, and if we do apologizing may help to reconcile us to them, but we only sin against God. James told us to confess our sins to each other in the context of a group prayer for healing. (James 5:16) I believe he was talking about a general confession to God before witnesses to purify us from all unrighteousness (1 John 1:9) so that our prayer won’t be hindered. I don’t think he meant we should disclose each of our sins to those around us.
Someone once said that public sin requires public confession. I think that means if we sin in a way that becomes known and embarrasses our loved ones, or if a public official sins in a way that erodes the public trust, then a public apology is in order. But as David wrote, the sin is against the Lord.