Christians are to confess their sins to God—not men. Notice David's example in Psalm 51. No man can forgive sins. Neither has any man other than Jesus Christ, our High Priest, been given the office of mediator between mankind and God. The apostle Paul was inspired to write: "Therefore He [Christ] is also able to save to the uttermost those who come to God through Him, since He ever lives to make intercession for them" (Hebrews 7:25). The apostle Paul also writes in I Timothy 2:5: "For there is one God and one Mediator between God and men, the Man Christ Jesus." Thus, the Bible clearly shows that confession of one's sins ought to be made to God, not to a fellow human being.
John writes that, when we sin, "we have an Advocate with the Father, Jesus Christ the righteous," who is "the propitiation [the atoning sacrifice] for our sins" (I John 2:1-2). He is faithful to forgive our sins when we confess to Him (I John 1:9). Therefore, we can come boldly to God's throne of grace (Hebrews 4:14-16).
The Scriptures do tell us that we may confess our faults to one another for the purpose of praying for each other (James 5:16). However, there is a difference between seeking a brother's help in overcoming a fault—a human weakness—and confessing sins of the past. The latter should usually not be done because only God can forgive sin. God forgets our sins once He removes them (Hebrews 8:12; Psalm 103:12), but humans do not forget, and once others know our sins, our relationships with them can be stained forever.
Some try to use John 20:23 to prove that persons in ecclesiastical offices have the power to forgive sins. This verse reads: "If you forgive the sins of any, they are forgiven them; if you retain the sins of any, they are retained." This verse does not mean that mere men can actually forgive sins in a spiritual sense, something God alone can do (Mark 2:7-10; Luke 5:21-24). Christ speaks these words to His future apostles in the context of the authority He was giving them within their commission (see John 20:21). Here, He gives them the power to put out of the church, or disfellowship, those who are dissenters or heretics (see Romans 16:17-18; I Corinthians 5:1-5; II Thessalonians 3:6, 14-15; I Timothy 1:18-20) and to bring them back into the congregation upon repentance (II Corinthians 2:6-10).