Muslims are opposed to euthanasia:
O ye who believe! Seek help with patient perseverance and prayer; for Allah is with those who patiently persevere. And say not of those who are slain in the way of Allah: “They are dead.” Nay, they are living, though ye perceive (it) not. Be sure we shall test you with something of fear and hunger, some loss in goods or lives or the fruits (of your toil), but give glad tidings to those who patiently persevere, Who say, when afflicted with calamity: “To Allah We belong, and to Him is our return”— (Surah 2:153-156).
O ye who believe! Eat not up your property among yourselves in vanities: But let there be amongst you Traffic and trade by mutual good-will: Nor kill (or destroy) yourselves: for verily Allah hath been to you Most Merciful! (Surah 4:29).
The Prophet Muhammad (pbuh) said that anyone who killed themselves would go to hell:
Anyone who throws themselves down from a rock and commits suicide will be throwing themselves into Hell. A person who drinks poison and kills themselves will drink it for ever in Hell. A person who stabs themselves will stab themselves for ever in Hell. (Hadith)
Muslims say that the time when someone will die can only be decided by Allah:
If Allah were to punish men for their wrong-doing, He would not leave, on the (earth), a single living creature: but He gives them respite for a stated Term: When their Term expires, they would not be able to delay (the punishment) for a single hour, just as they would not be able to anticipate it (for a single hour) (Surah 16:61).
Nor can a soul die except by Allah’s leave, the term being fixed as by writing. If any do desire a reward in this life, We shall give it to him; and if any do desire a reward in the Hereafter, We shall give it to him. And swiftly shall We reward those that (serve us with) gratitude (Surah 3:145).
Suffering is a test of iman (faith) and euthanasia is seen as zalim, wrongdoing against Allah.