If you are going into hospital for an operation and will be having a general anaesthetic then you should celebrate the Sacrament of the Sick, or indeed in the case of old age or great sickness, the Sacrament should be administered. Remember that going into hospital, given the General Data Protection Regulations, (GDPR) you now have to request to see a chaplain / priest or if you wish a priest other than the hospital chaplain to see you, then, you must give the name of the priest and his contact number. If a person is unconscious going into hospital, only the next of kin / designated carer can make the same request on behalf of the patient. In short, chaplains DO NOT have direct access to patients, the patient must request to see the chaplain.
Additionally, if you or a relative is unwell and wishes to see a priest whether at home, in hospital or any kind of care facility/ home, DON'T PRESUME that your situation is known, contact the priest and inform him of your situation. In such circumstances, which might well require and immediate response, it is far better to phone than to send e-mails or text messages
The theology of the Sacrament of the Sick can be found in the Catechism of the Catholic Church at: https://www.vatican.va/archive/ENG0015/__P4J.HTM and the following pages of the Vatican website.