Act of Contrition
The penitent says this aloud in the confessional before the priest gives absolution; the wording comes from the catechism tradition of the last few centuries. It names two reasons for sorrow, fear of punishment and love of God, and the Church teaches that the second, called perfect contrition, is the one that matters most. The last line is a promise, not only a feeling: confess, do penance, change.
Traditional, catechism form
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 thy grace,
to confess my sins, to do penance, and to amend my life.
Amen.