There is no requirement to injure one’s health for the sake of performing any positive commandments.
Therefore, it is considered forbidden to fast on fast days if doing so could be injurious to one’s health (Shulchan Arukh, Orach Chayim 618:1).
Vital medications should be taken on fast days, even with food, if that is the proper way to ingest the medicine. However, one should not eat more than is necessary to maintain one’s health.
If an individual feels that fasting will be harmful, then that individual is permitted to eat on a fast day even if a physician determines that fasting will not cause real damage to that person’s health (Shulchan Arukh, Orach Chayim 618:1).
On the other hand, if a physician determines that an individual should not fast on one of the fast days, then that opinion should be followed even if the individual in question feels quite capable of fasting (ibid.).
The bottom line is that one’s health always comes first: when eating is necessary to a person’s continued good health, it becomes a requirement for that person to eat.
Adapted with permission from The Observant Life.