How to make an act of perfect contrition
Through an act of Perfect Contrition, you can receive the forgiveness of your sins outside of confession, even mortal sins, provided that you determine yourself to correct your life and make a firm resolution to go to sacramental confession as soon as possible, when it becomes once more available.
In reality, or in your mind, kneel at the foot of a crucifix and repeat: "Jesus, my God and my Saviour, in the midst of your agony you remembered me, you suffered for me, you wanted to purify me from my sins".
Contrition is "perfect" if you repent of your sins because you love God and you sincerely regret having offended Him and having contributed Christ's sufferings on the Cross.
Recite, slowly and sincerely, an act of contrition focusing on the goodness of God and your love for Jesus: "O my God, since you are so good I am sincerely repentant for having sinned against you and with the help of your grace I will no longer sin. Amen".
Make a firm resolution to go to sacramental confession as soon as possible.