Those who are ill, or in danger of death, benefit from the sacraments of Anointing, Reconciliation, and Holy Communion,
which are often accompanied by a special type of indulgence, called the Apostolic Pardon.
The Apostolic Pardon (Apostolic Blessing) must be administered by a priest. The pardon does not forgive sins. It typically makes time in Purgatory unnecessary. Many of today’s priests don’t routinely administer the Pardon, so you may need to specifically request it
Apostolic Pardon:
By the Faculty which the Apostolic See has given me, I grant you a plenary indulgence for the remission of all your sins, and I bless you. In the Name of the Father and the Son + and the Holy Spirit. Amen.
But also know that a special plenary indulgence is granted by The Church for the dying. This is normally included in the last rites, but in the event a priest is not present, the Church grants a plenary indulgence to the faithful “at the point of death, provided they are properly disposed and have been in the habit of reciting some prayers during their lifetime” (norm 18).
The Rite of Extreme Unction (last rites) in which the Sacrament is offered includes the Sacraments of Penance and the Eucharist (in that order), followed by the Sacrament of Unction itself.
It may be received conditionally up to three or four hours after apparent death (we can’t presume to know the moment the soul leaves the body and can only know with moral certainty that death has occurred after corruption has begun). If the sick one is unconscious, conditional absolution and Unction are offered, without the Eucharist (known at this time as “Viaticum,” meaning “Food for the Journey”).
All that said, only God knows for absolute certainty what the soul held in its last moments before it left its body to face God. Therefor my personal recommendation would be to still offer up many masses and mass prayer cards for the deceased as well as performing as many plenary indulgences as one might be able to perform for a period following the death of a loved one. Rest assured that no prayer will ever go to waste and so its certainly a charitable deed to offer up indulgences for a departed loved one or friend - especially on the highly indulgenced feast days (and All Souls Day Octave and month of November).
I also recommend saying the Divine Mercy Chaplet even for those who are already died since God can hear those prayers in the “now of eternity” as if pleaded before that person died. St. Faustina tells us that Jesus’ is so moved by this prayer that he can not and will not ignore it when spoken in faith by a person who commits their life to merciful acts.
James