That question is usually followed by the words “I go directly to God”.
While you are welcome to think you can go "directly to God", the problem is, Jesus nowhere says to do that. In fact, the Bible instructs us to confess our sins, not to God, but "to one another”:
"Therefore, confess your sins to one another and pray for one another, that you may be healed." (James 5:16)
But who is the "one another" to whom we are to confess? Shall we just pull someone off the street and confess our sins? Of course not.
The directive to "confess your sins to one another" occurs within the context of an instruction on the Sacrament of the Sick in which James instructs the Christian community to call the "presbyter", who is to anoint the sick person and hear his confession:
“Is anyone among you sick?" He should summon the presbyters of the church, and they should pray over him and anoint [him] with oil in the name of the Lord, and the prayer of faith will save the sick person, and the Lord will raise him up. If he has committed any sins, he will be forgiven. Therefore, confess your sins to one another and pray for one another, that you may be healed.” (James 5:14-16)
It is clear, in this passage, that the main agent of anointing and forgiveness is the "presbyter". In the early Christian communities, a presbyter ("overseer") could have been a bishop or another man authorized to act in his place, much as the parish priest does today. In any event, the presbyter is distinguished from the rest of the community because he is to be summoned by the others, and he appears to have certain powers that the other Christians do not.
"But", you may say, "only God can forgive sins". This is true. It is also true that God can do anything, including authorize others to forgive sins. And this he does in John 20:19-23:
“On the evening of that first day of the week, when the doors were locked, where the disciples were, for fear of the Jews, Jesus came and stood in their midst and said to them, ‘Peace be with you.’ When he had said this, he showed them his hands and his side. The disciples rejoiced when they saw the Lord. [Jesus] said to them again, ‘Peace be with you. As the Father has sent me, so I send you.’ And when he had said this, he breathed on them and said to them, ‘Receive the Holy Spirit. Whose sins you forgive are forgiven them, and whose sins you retain are retained.’” (John 20:19-23)
Given that the Resurrection is the central act of all history, it is quite profound, when you think about it, that Christ's first order of business upon rising from the dead is to give the apostles the power to forgive sins. This should strike us with a rather terrible significance. He has just risen from the dead. He has just walked through a wall (the doors were locked). The apostles are probably beside themselves. And the very first thing he does is to make them new men (he "breathed on them") and give them the power to forgive sins!
In fact, the forgiveness of sins is their primary mission. This is what they are sent to do ("so I send you"). And the very fact that Christ empowers these men to forgive sins and sends them forth to do so automatically makes it incumbent upon the rest of us to seek this forgiveness of sins from those men who are authorized to grant it: our priests and bishops. Given that this is Christ's desire, it is the height of disobedience and sinful obstinacy to not seek forgiveness in the Sacrament of Confession.
Some think that Christ simply intended a general spirit of Christian forgiveness and not the on-your-knees-in-front-of-the-priest type of confession. However, the fact that the apostles were granted the power to both forgive and "retain" sins tells us that the power is juridical, that the apostles (and those authoritatively descended from them) are to sit in judgement on the penitent's sins. And in order for there to be a judgement there must first be a hearing - thus, the confessional and the oral accounting of our transgressions (and preferably on our knees).
We also know that the power to forgive sins was not meant just for the Apostles but was intended to be passed on to those whom they would ordain. We know this because the presbyters mentioned in James are not Apostles, but specially authorized (ordained) members of the Christian community who are obviously authorized to hear and forgive sins as the apostles were. Today, that power has descended through the Sacrament of Ordination to the bishops and priests who walk among us today.
Given the timing of the institution of the Sacrament and the centrality of the forgiveness of sins in the apostolic mission, there can be no doubt about the critical importance of the the Sacrament of Reconciliation and the necessity of our availing ourselves of it. And we must no longer fool ourselves about "confessing directly to God". It is simply not his will that we do so.
Now just a couple of practical matters. The Sacrament of Confession demands that there be a place for it, a confessional. Church Law (Canon 964) requires that confessionals be in a church or oratory, 2) that there be “a fixed grate between the penitent and the confessor...”, 3) that the confessionals be “in an open place so that the faithful who wish to can use them freely”, and 4) “Confessions are not to be heard outside a confessional without a just cause.”
In other words, we shouldn’t have to hunt for the confessional, we must have the option of an anonymous confession (a fixed grate), and sitting out in the open hearing confessions - a practice that has been in vogue for several years - is not the norm.
Also Canon 986 requires that confession be scheduled so that penitents “have the opportunity to approach individual confession on days and at times established for their convenience.” Regularly scheduled times for confession are critical to the right to an anonymous confession since having to seek out a priest to hear one’s confession precludes anonymity.
And speaking of anonymity, I personally always go to confession behind the grate, even if the priest knows me. I do it out of consideration for the priest. The priest is bound not only to never reveal the sin of a penitent, but to try to forget the sin once the confessional encounter is over. How much harder is it for him to do - as a man - when he has a face to go with the sin.