The text
The wording most English-speaking Catholics learn is this one:
O my God, I am heartily sorry for having offended Thee, and I detest all my sins because of Thy just punishments, 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 sin no more and to avoid the near occasions of sin. Amen.
A shorter form, used widely and easy to remember under pressure:
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 Saviour Jesus Christ suffered and died for us. In his name, my God, have mercy.
And if neither comes to mind, this is enough:
Lord Jesus, Son of God, have mercy on me, a sinner.
That last line is not a fallback invented for the nervous. It stands in the Rite of Penance itself as one of the permitted prayers.
What the prayer actually contains
Strip the old-fashioned English away and four things remain — the same four the Catechism names when it describes contrition (CCC 1451–1453).
First, the sorrow. "I am heartily sorry." This is a judgement, not a mood: what I did was wrong, and I own it as mine.
Second, the lesser motive. "Because of Thy just punishments." This is fear, and fear is allowed. The Catechism calls it imperfect contrition and says plainly that it suffices for the sacrament.
Third, the greater motive. "But most of all because they offend Thee, my God, who art all good." Here the prayer moves from fear to love. This is perfect contrition, and the formula puts it second precisely to say that it is the more important of the two.
Fourth, the resolution. "I firmly resolve … to sin no more and to avoid the near occasions of sin." Without this part there is regret but not repentance. And note how concrete it is: it is not enough to intend to avoid the sin, you intend to avoid the situations that lead to it.
When it is prayed
In confession the Act of Contrition comes after you have told your sins and before the priest gives absolution. Often he will simply nod, or say "now make your act of contrition".
If nothing comes at that moment, say so. It is an extremely common situation and no priest is surprised by it. Even this will do: "Lord, I am sorry for what I have done, and with your help I want to change."
The Latin text, and a common mix-up
Search for the Act of Contrition in Latin and you will almost always find the catechetical formula:
Deus meus, ex toto corde paenitet me omnium meorum peccatorum, eaque detestor, quia peccando non solum poenas a te iuste statutas promeritus sum, sed praesertim quia offendi te, summum bonum ac dignum qui super omnia diligaris.
That is the traditional devotional text. The Latin of the reformed rite is a different prayer: it speaks of "everything I have done wrong and the good I have failed to do", it asks explicitly to do penance, and it does not mention deserved punishment at all. Both are in use, and neither has been withdrawn. If you have ever wondered why English and Latin versions do not line up word for word, that is why.
Perfect contrition, and why it matters in practice
The distinction sounds academic and is not. Imperfect contrition — sorrow out of fear of hell or out of disgust at the sin — is sufficient for a valid confession (CCC 1453). You do not have to work yourself up into a purer motive before you may go.
Perfect contrition goes further. Sorrow arising from love of God, joined to the firm intention of confessing as soon as possible, already obtains the forgiveness of grave sins before you reach the confessional (CCC 1452). This is why the Church has always urged an act of contrition on the dying, and why it is worth praying at night: you do not know how the night will end, and the intention to confess remains.
If the resolution does not hold
The most honest question about this prayer is: can I really promise not to sin again, knowing that I probably will?
The resolution is not a prediction about the future. It is the direction of the will now. Someone who says "I intend never to do this again" and falls three weeks later has not lied — they have fallen. What would be dishonest is the resolution made with a mental reservation, the one that already plans the next time.
This is where a daily review helps. Whoever looks back on each evening notices after three weeks that the resolution is always the same one, and that the fall always has the same run-up. Ignatius called this the Particular Examen: take a single point and watch it until you can see where it comes from. It is exactly what Lumen is built for, with a journal that stays encrypted on your own device and never reaches a server.