The dying person needs to face his mortality, to repent, to pray, to receive Unction, to be encouraged to trust totally in Jesus and His forgiveness and love, etc.
He must spiritually prepare himself for judgement, and to help him do this is the single greatest act of love you can offer.
Into Thy hands, Lord, I commend my spirit.
O Lord Jesus Christ, receive my spirit.
Holy Mary, pray for me.
Holy Mary, Mother of grace, Mother of mercy,
do thou defend me from the enemy,
and receive me at the hour of death.
St. Joseph, obtain for me grace and mercy!