We have made many medical advancements in the last century, so we don’t die as young as we used to or from many diseases that no longer exist. However, most people would still rather die in their homes than in a facility, according to the Economist in "How to have a better death."
In fact, the majority of people are not happy that they cannot choose when and where to die. People are often given life-saving treatment by doctors that they do not want.
At other times people with little hope of long term survival are not given the opportunity to choose the timing of their own deaths, which leads them to linger on in pain.
This is the primary reason for the movement to legalize physician-assisted suicide, which is slowly picking up steam, as more and more states consider it.
Since it will not be an option for everyone for a long time, however, it is important that people take some matters they can control into their own hands.
Everyone should have advanced medical directives such as a health care proxy, at a minimum, that dictate what procedures doctors can and cannot use to prolong their lives.
An elder law attorney or estate planning attorney can guide you in setting up a plan that fits your unique circumstances.
Reference: Economist (April 29, 2017) "How to have a better death."