This is the traditional “Act of Contrition” said by Catholics in the confessional. It requires that they have a sincere repentance for their sins, a firm resolve to not commit them again and even to avoid any situations that might weaken their resolve.
ACT OF CONTRITION
O my God, I am heartily sorry for having offended You,
and I detest all my sins because of Your just punishments,
but most of all because they offend You, my God,
who are all good and deserving of all my love.
I firmly resolve, with the help of Your grace, to sin no more,
and to avoid the near occasion of sin.