Euthanasia is a Greek word literally meaning “good death”. It is generally used as a term to describe a patient’s right to demand putting an end to his/her life from an official institution.
Someone who is decided to be in an unrecoverable situation and demands to be killed can never be killed. It does not matter even if the patient is in a permanent vegetative state. Killing the patient with or without consent is absolutely illegal and unlawful.
Nobody has a right to take one’s life besides Allah. Killing someone (or self) is like killing all mankind.
“Therefore We ordained for the Children of Israel that he who slays a soul unless it be (in punishment) for murder or for spreading corruption on earth shall be as if he had slain all mankind; and he who saves a life shall be as if he had given life to all mankind.” (The Feast 5:32)
Life is full of troubles. We all see people that give up hope for life, getting recovered and walking beside us as before. Sicknesses, troubles and hardships are for the mankind. We should show fortitude and hold on to our hopes until the end.
“Allah is with those who show fortitude.” (The Cow 2:153)
Killing the self or getting assist on this, is certainly unlawful.
Someone who is about to die can still be heir to someone, become Muslim, or repent from his/her sins. This person’s legal competence goes on until he is definitely dead. Someone who kills a person on this situation with or without consent should be punished by murder.