I separate extreme measures to keep someone 'alive,' which I call prolonging dying, from euthanasia. I view these as separate things, though I know that others do not.
It is important to discuss end of life issues with one's loved ones and to include one's spiritual advisors or equivalent in those discussions. Here in Indiana, there are documents called living wills. There are separate documents in the case of an accident or in the case of illness. The person while in his or her sane and sound mind fills these out and files them with his or her physician, the hospital, the spiritual advisor or equivalent, keeps a copy in the freezer (yes the freezer), and with what is called a "medical power of attorney." This is different from a regular power of attorney, and the powers of the medical power of attorney cease upon the death of the person in question. The medical power of attorney has the authority, granted by the person, to determine what medical assistance the person should receive when that person is unable to make his or her wishes known. Note: family members are not necessarily the best people to make those decisions as family members may not agree with what YOU want. For example: I would never entrust my brother with making those decisions for me, and I think the opposite is true as well. We simply hold opposite views on this issue, and I do not think it is right to cause a loved one to make decisions opposite to his or her convictions or to make that loved one make a decision in opposition to what he or she knows the other really has decided.
It is important to revisit these documents on a regular basis. What you may decide when you are say 40 may be very different when you are 50 or 60 or 80 or whatever.
It is important to have a doctor who agrees with your end-of-life beliefs in order to avoid potential frictions. Such frictions have occurred.
These documents are very important. It is much easier legally to keep the machinery from being hooked up in the first place, than to have the plugs pulled. It is also easier to refuse chemotherapy etc. than to stop treatments after they have started. Personally, I don't view pulling the plug or refusing chemotherapy or tranplants etc. as euthanasia, but others do.
Note: In Indiana at least, by law if one is in an accident, they have to hook you up to brain scan and some other machinery for 24 hours. What happens after that is determined by what is in the end of life in case of accident papers. If no papers are on file, hospitals tend to keep the machinery and so forth going, unless - and I'm being cynical here - the person has no family, no insurance, or no money.
Now as for euthanasia that isn't a matter of unplugging machinery or refusing chemotherapy etc. I personally don't agree with it. This I view as a form of assisted killing. No, I don't think patients should needlessly suffer, and caregivers should provide what is necessary to alleviate suffering, but not to deliberately end the life.