The Church tells us that we need to go to the sacrament of Penance, be truly repentant of our sins and so "make a good confession", when we are conscious of grave sin is to be reconciled with God and the Church”.
So what happens when we can't go to Confession?
The Church also teaches that physical or moral impossibility excuses us from confession in such a case and reconciliation can be obtained by other means.
Basically, if we can go to Confession then we must go to Confession. But if we are in hospital, self-isolation, or social-distancing makes it impossible, and we cannot go to Confession then God loves us so much that He offers us other means of forgiveness.
If we cannot get to Confession but truly wish our sins forgiven then we must make an act of perfect contrition. “Contrition is sorrow of the soul and detestation for the sin committed, together with the resolution not to sin again” , and “when it arises from a love by which God is loved above all else” then it is called perfect and it “obtains forgiveness of mortal sins if it includes the firm resolution to have recourse to sacramental confession as soon as possible” .
In making an act of perfect contrition we could use the words that are familiar to us from the “I Confess” at Mass or from the “I love thee, Jesus, my love above all thing” at Stations of the Cross, or we could use whichever act of contrition we normally use in Confession, but what matters is not the words so much as the intention behind the words, the intention to love God, to be truly sorry for our sins, and to intend to Confess in the normal manner as soon as possible.
(acknowldgement, much of the above text written by Canon Paul Gargaro)