You have heard of patients who died painful, lingering deaths, hooked up to tubes and machines.

You don't want that ever to happen.

What can you do?

You have both a moral right and a solidly established legal right, providing you are mentally competent, to refuse any treatment you do not want. But what if you are unconscious or in a coma or unable to think or speak clearly? Or if your refusals may be ignored by well-meaning physicians and nurses?

The most important thing to do, say many authorities, is to discuss your wishes now, whatever your age, with your family and your doctor, or any doctor who cares for you in any future illness of any seriousness.

"It is vital that your doctor know your wishes," says Fenella Rouse, director of legal services for the Society for the Right to Die. "And it is vital that you discuss your wishes with your doctor, because only your doctor can give you the medical information you need to make the proper choices."

You can sign, with witnesses, a "living will," a document that says that in the event you are being kept alive artificially with no hope of recovery, that you be allowed to die naturally with medication only to keep you comfortable.

Signing the will does not commit you irrevocably. You can always change your mind. Your last wishes, oral or written, should always prevail.

But the living will has been given full legal status by "natural death acts" in 38 states, including Maryland and Virginia, as well as in the District. In other states, it still can be influential. One thing it does is help protect doctors who may otherwise refrain from "pulling the plug" for fear of being accused of hastening your death unethically or unlawfully.

Nothing in such acts -- says a typical one, the District's -- "shall be construed to condone, authorize or approve mercy killing," or to allow any act "other than to permit the natural process of dying." Also, says Rouse, "whenever possible appoint an agent" -- a family member, friend, member of the clergy or attorney -- "who can speak for you" and make sure your wishes are carried out.

A legally solid way to appoint an agent is to see a lawyer to give the agent a durable power of attorney, "durable" meaning the appointment remains valid even if you become incompetent. A power of attorney also gives the appointee the power to do other things, like sign your name to other documents or take over your finances. Do not confer one lightly.

Not everyone wants to do these things or even think about them. That too is your right.

"But people who care about exercise of their rights have a responsibility as well," Rouse says, a responsibility to take these kinds of measures. The time to fight for your rights is when you're well and strong," she points out. "It's difficult to fight for your rights when you're sick."