From YOUCAT, page 135:
228: Who can forgive sins?
God alone can forgive sins. Jesus could say “Your sins are forgiven” (Mk 2:5) only because he is the Son of God. And priests can forgive sins in Jesus’ place only because Jesus has given them that authority. [1441-1442]
Many people say, “I can go directly to God; why do I need a priest?” God, though, wants it otherwise. We rationalize our sins away and like to sweep things under the rug. That is why God wants us to tell our sins and to acknowledge them in a personal encounter. Therefore, the following words from the Gospel are true of the priests: “If you forgive the sins of any, they are forgiven; if you retain the sins of any, they are retained.”