More commonly remembered as Anointing of the dying or remembered by many as the "Last Rite". It used to be administered to a dying person, even after s/he died, known as conditional anointing.
It is now more commonly given to someone who has a grave illness, or is about to be admitted to hospital for major surgery. The church accompanies them at this time of trial by the sacrament which strengthens them and casts away their fear, knowing that the Spirit of the Lord will be with them and bring them peace.
The sacrament can be repeated when the person recovers and later faces another health crisis. In fact, the sacrament is often administered in nursing homes or even in parishes regularly for those who are elderly, frail or others who have serious health challenges.
As sacraments are for the living, the anointing sacrament is not given to someone who is already dead. Should the family request a priest, he goes to pray with them and ask God's loving mercy upon the deceased and give consolation to the family at this trying time as they face the death of a loved one.
Family members who call for the anointing should be present when the priest anoints their loved one, to ensure that they witness the anointing and do not feel anxious about whether or not the sacrament has been celebrated.
The ritual of anointing includes prayers that are uplifting and shows the supportive presence of the church, not to hasten the death but to accompany the sick with God's loving consolation at his/her time of trial. It is therefore not necessary to wait until death is imminent for the sacrament to be administered.