From a personal perspective, the most important thing you can do is have a living will, and make sure your family understands what your wishes are. If you don't want to be left on a machine with a tube down your throat
write up a legal document that says so.
It's also worth noting the difference between what what doctors will do for their patients and
what they want for themselves. The graph below (when asked what treatments they would want with an irreversible brain injury) makes it startlingly clear:
Yet despite this, they are required to perform all of these if the next of kin says to go for it.