Why do Catholics confess to a priest?
“That you may know that the Son of Man has the power to forgive sin…” (Mt. 9:6; Mk 2:7-10; Lk 5:21-24). The direct translation from the Greek is ben-Adam which means son of Adam. Jesus also commanded the apostles to absolve sin. He communicated this authority to His Apostles on Easter night, “Whose sins you shall forgive they are forgiven, whose sins you shall retain they are retained” (Jn 20:19-23). This even provides instructions, the priest must decide what sins to forgive and what sins to retain. The penitent must demonstrate true contrition for their sin. Jesus’ passion and death merited forgiveness for any repentant sinner. This forgiveness of sins does not mean, “Hey dude you’re forgiven it’s okay to sin just jump right back out there!” In the sacrament to priest I confess to says “Go in peace with the strength of the Holy Spirit and sin no more.” Note that this may vary from priest to priest. It also gives great peace to hear the priest say in Jesus’ name “I absolve you from your sins in the name of the Father and of the Son and of the Holy Spirit.”
Why not confess directly to God?
“By sin, it was God that was offended; and God set down the conditions for forgiveness. You cannot insist of God that He forgive your sins on your own conditions. And Jesus Christ did not bestow the power and responsibility to forgive sins to the Apostles and their successors knowing that all one needed to do was to seek forgiveness through prayer. The Church does not deny that sins will be forgiven via prayer directly to God, given of course that there’s true repentance coupled with firm resolution to avoid this sin in the future; however, the only way we can be sure of proper disposition of the forgiveness of sin with absolute certainty is via the means established by Christ – the sacrament of Penance. “ http://www.scborromeo.org/papers/confess.pdf
God is all knowing and merciful and who are we mere humans to set rules on Him? Catholics are following the prescription we read in the bible. God in His goodness may decide to forgive the murderer and they could find that after they die but the only way you can be sure your sin is truly forgiven is to be absolved by the priest. For a sin to be forgiven all that is necessary is to be truly sorry and the priest sees when we are truly sorry and forgives us as God’s mediator. I also find that it helps to talk over the sin especially if it keeps occurring so the priest can counsel you and help find ways to stop in a confidential setting. Chances are he has already helped someone through the very same sin!