According to Noahide halacha (Torah Law), in general it is forbidden to command the doctors to shut down a life-sustaining machine, and it is forbidden for the doctors to shut down the machine, after it has been put into operation.
It is well known that people have woken up and recovered after months or even years in a coma, even after doctors have claimed that there is no chance for the person to wake up.
However, it is proper to consult with an expert traditional Orthodox Rabbi for a ruling on a case-by-case basis, as the halachic and medical issues may be complicated and unknown to a layperson.
On the other hand, if a person's vital functions are failing or he has sustained massive injuries, G-d forbid, it is not necessarily required to put the person on a life-support machine. The medical condition of the patient, and the living-will directives he may have given or the sound-minded wishes he may be expressing under the circumstances, may be taken into account when making that decision.
Again, as above, if there are questions as to what should or may be done at that point, within the parameters of Torah Law for Gentiles, it is proper to consult with an expert traditional Orthodox Rabbi for a ruling on a case-by-case basis.
Please see the section on Euthanasia in this excerpt from "The Divine Code," by Rabbi Mosh Weiner, which explains the halacha for Gentiles:
https://asknoah.org/wp-content/uploads/p...anasia.pdf