Catholics must go to confession at least once a year. In order for a person's sins to be absolved (forgiven), the penitent (person confessing) must ask forgiveness, be sorry for committing the sin and intend not to commit the sin again.
O my God, I am sorry for my sins because I have offended you. I know I should love you above all things. Help me to do penance, to do better, and to avoid anything that might lead me to sin. Amen.
or
O my God, I am heartily sorry for having offended Thee, and I detest all my sins, because I dread the loss of heaven and the pains of hell, but most of all because they offend Thee, my God, who art All Good and deserving of all my love. I firmly resolve with the help of Your Grace to confess my sins, to do penance and to amend my life.
or
My God, I am sorry for my sins with all my heart. In choosing to do wrong and failing to do good, I have sinned against you, Whom I should love above all things. I firmly intend with your help to do penance, to sin no more and to avoid whatever leads me to sin. Our Savior Jesus Christ suffered and died for us. In His Name, my God, have mercy. Amen.