A very difficult subject. (Even Jesus wouldn't touch that one with an 80 foot pole!)
Anyway, it's all pretty easy when the person in question is still able to communicate with other people.
But when it's someone is in a vegetative state/coma/suffering from severe dementia/... things get much more dificult.
The only real advice I can give is making an official statement or a will of some kind about what you want to have done to you if you should ever face problems like this.
E.g. Someone I know told me that if this would ever happen to her she would want to die and her family should "pull the plug".