According to the Catechism of Trent, The sacrament of Anointing of the Sick has as its purpose the conferral of a special grace on the Christian experiencing the difficulties inherent in the condition of grave illness or old age.
And the CCC reiterates these immemorial teachings
1531 'The celebration of the Anointing of the Sick consists essentially in the anointing of the forehead and hands of the sick person (in the Roman Rite) or of other parts of the body (in the Eastern rite), the anointing being accompanied by the liturgical prayer of the celebrant asking for the special grace of this sacrament.'
- the uniting of the sick person to the passion of Christ, for his own good and that of the whole Church; the strengthening, peace, and courage to endure in a Christian manner the sufferings of illness or old age; the forgiveness of sins, if the sick person was not able to obtain it through the sacrament of Penance; the restoration of health, if it is conducive to the salvation of his soul; the preparation for passing over to eternal life.
Mark 6:13; James 5:14 ; Gal. 4:13-14; 2 Tim. 4:20
image from the 'Public domain' via wikimedia commons. The Seven Sacraments (1445) by Roger van der Weyden.