Someone for whom fasting is liable to cause death has a mitzva to eat and drink as needed, since saving life overrides the mitzva of fasting – and all mitzvot in the Torah – as we read, “You shall keep My laws and My rules, by the pursuit of which man shall live; I am the Lord” (Vayikra 18:5). Our Sages infer: “‘By which man shall live’ – and not die” (Yoma 85b). The mitzvot were given to promote life, not to cause death (Peninei Halakha: Shabbat 27:1 n. 1). If one is uncertain whether his life is in danger but is “stringent” and does not eat and drink, he is a sinner, as he violated the Torah’s commandment to preserve his life. Of him, the Torah says (Bereishit 9:5), “But for your own life-blood I will require a reckoning” (Bava Kama 91b).
Permission to eat is not limited to cases of grave danger. Rather, as long as there is a chance that fasting will cause a person’s death or weaken his ability to fight off an illness that afflicts him, it is a mitzva for him to eat and drink as needed. Even if someone is already gravely ill, if fasting will likely hasten his death, it is a mitzva for him to eat and drink as necessary, for it is permitted to eat and drink on Yom Kippur even to extend life temporarily.
On the other hand, this should not be taken too far by worrying about remote concerns, for if we were to view every routine illness as possibly life-threatening, it would render moot the halakha that someone sick is obligated to fast on Yom Kippur. Furthermore, anyone with the flu would need to be hospitalized, or at least have a doctor check on him twice a day. Were we really to worry about such levels of risk, we would have to forbid travel by car or plane. Certainly, we would have to prohibit cars that have not passed inspection within the last month. We would also have to prohibit hiking and many other activities.
Rather, the principle is that any danger that people normally treat with urgency and on which they spend time and resources – like rushing someone to the hospital in the middle of a workday – is considered life-threatening. To prevent such danger, it is a mitzva to desecrate Shabbat and to eat and drink on Yom Kippur. However, a danger that people do not normally address immediately with the expenditure of time and resources is not considered life-threatening.
One who wishes to be stringent and fast even when it is dangerous is not doing a mitzva but rather a sin. One might mistakenly think that this is comparable to a case in which a non-Jew, for his own pleasure, orders a Jew to transgress. In that case, the Jew is not required to sacrifice his life to avoid transgressing, but he may choose to do so in order to sanctify God’s name (Tosafot, Avoda Zara 27b, s.v. “yakhol,” even though Rambam in MT, Laws of Torah Principles 5:1, disagrees and writes that he may not choose death). In our case (of someone dangerously ill), all agree that he may not fast, as doing so does not involve any element of sanctifying God’s name. Rather, just as God commands him to fast, here He commands him to take care of his health.