In his time on earh, Jesus was very compassionate and healed many who were sick.
Inspired by his example St James wrote in his letter, "Are any among you sick? They should call for the elders of the church and have them pray over them, anointing them with oil in the name of the Lord. The prayer of faith will save the sick, and the Lord will raise them up; and anyone who has commited sins will be forgiven." (James 5:14-5 NRSV translation.)
Each time a Christian falls seriously ill, she/he may receive the Anointing of the Sick. (Catechism of the Catholic Church CCC #1529) Only priests can give the sacrament of the Anointing of the Sick, using oil blessed by the Bishop. (CCC #1530)
The Sacrament of Anointing of the Sick is available during several different masses each month, including:
VIATICUM, THE LAST SACRAMENT OF THE CHRISTIAN
In addition to the Anointing of the Sick, the Church offers thos who are about to leave this life the Eucharist as viaticum. Communion, received at this moment of "passing over" to the Father, has a particular significance and importance. (CCC #1524)
The Sacraments of Penance, the Anointing of the Sick and the Eucharist as viaticum at the end of a Christian's life are "the sacraments that prepare for our heavenly homeland". They are the sacraments that complete a person's earthly pilgrimage. (CCC #1525)