Answer:
If the person is conscious and able, he should make his confession (the sacrament of Penance or Reconciliation). He then receives Holy Communion (the Eucharist), and the final anointing of Extreme Unction which is for his healing, in the case of a dying person the healing of his soul and the remission of any sin. In justice there is usually some penance to be done for sin and the strength of the anointing and the grace is to help the person use his last pains as expiation for sins.