I will provide an answer based on a comment I originally gave.
For how to dispose of a body after death, that is determined by somebody's will. But if you're talking about how to handle medical circumstances prior to death, the term you are looking for is living will.
A living will, despite its name, isn't at all like the wills that people use to leave property at their death. A living will, also called a directive to physicians or advance directive, is a document that lets people state their wishes for end-of-life medical care, in case they become unable to communicate their decisions. It has no power after death.
If you’re helping someone with their estate planning (or doing your own), don’t overlook a living will. It can give invaluable guidance to family members and healthcare professionals if a person can’t express his or her wishes. Without a document expressing those wishes, family members and doctors are left to guess what a seriously ill person would prefer in terms of treatment. They may end up in painful disputes, which occasionally make it all the way to a courtroom.
Also, people who have the authority to make medical decisions on behalf of a patient who can't speak (whether or not a living will is in place) are said to have power of attorney.
Per the Ontario government:
A Power of Attorney is a legal document in which you give someone you trust (called your “attorney”) the right to make decisions for you if something happens and you are no longer able to look after matters on your own.
There are two types of Power of Attorney:
Power of Attorney for Personal Care – the person you name can make decisions about your health care, housing and other aspects of your personal life (such as meals and clothing) if you become mentally incapable of making these decisions.
Power of Attorney for Property – the person you name can make decisions about your financial affairs (including paying your bills, collecting money owed to you, maintaining or selling your house, or managing your investments).