The Catechism of the Catholic Church explains that Anointing of the Sick is the sacrament that is received by those who are ill or suffering. "By the sacred anointing and the prayer of the priest, the whole Church commends those who are ill to the suffering and Glorified Lord, that he may raise them up and save them" (CCC 1499). "The first grace of this sacrament is one of strengthening, peace and courage to overcome the difficulties that go with the condition of serious illness or the frailty of old age. This grace is a gift of the Holy Spirit, who renews trust and faith in God and strengthens against the temptations of the evil one, the temptation to discouragement and anguish in the face of death. This assistance from the Lord by the power of his Spirit is meant to lead the sick person to healing of the soul, but also of the body if such is God's will. Furthermore, "if he has committed sins, he will be forgiven" (CCC 1520).
For more information on how one is united with Christ through this sacrament, download and read the Anointing of the Sick Handout
from the U.S. Conference of Catholic Bishops.