Medication on Shabbat and Yom Tov
As a general rule, medication should not be taken on Shabbat. This is a rabbinic decree that dates back to the Talmudic era when medications were usually prepared by grinding roots and herbs. These preparations were often done at home by the one needing the medication or another member of the household. Grinding, the melacha known as tochen, is one of the thirty-nine melachot that are prohibited on Shabbat. The sages were concerned that if it were permitted to take medication on Shabbat, people might forget themselves and grind the medicine on Shabbat itself -- something that is actually a Torah prohibition.
Although nowadays medications are not prepared in the manner they once were, rabbinic decrees remain in force even when it appears that the original reasons for the decree are no longer applicable. This is because we are not completely certain of all the possible considerations that the sages had for implementing their decrees. Nevertheless, there are a number of authorities who indeed rule that the decree against taking medications no longer applies. However, one should not be overly quick to rely on this opinion as it is the ruling of only a small number of authorities. Other authorities hold that although the original decree is still essentially binding, one may rule leniently with medication-related issues on Shabbat whenever there is a need to do so.
Of course, one whose life is in danger may, and actually must, take medication as needed. The decree is also relaxed for one who is in significant pain or confined to bed. Some authorities include headaches in this dispensation. Nevertheless, those with only minor ailments should refrain from taking medicine on Shabbat. According to almost all authorities, one whose ailment is so minor that it does not interfere with one's normal routine is forbidden to take medication on Shabbat.
One may consume all foods on Shabbat even if one’s intention for doing so is solely for their therapeutic benefits, such as drinking tea with honey, should one have a sore throat. One is also permitted to chew almonds as a remedy for heartburn. Many authorities allow one to take vitamins on Shabbat that are taken daily as food supplements. However, one should not take vitamins to relieve symptoms. One who began a course of prescription medicine before Shabbat may continue to take the medicine on Shabbat as normal. It is permitted to break or cut a pill on Shabbat if the full dosage is not needed.
It is interesting to note that one is permitted to take medicine on Shabbat in advance of an anticipated ailment as long as one is currently feeling fine. Similarly, one is permitted to prevent a wound from getting infected or to otherwise protect it from getting worse. As such, one may clean a wound or change bandages and dressings. One who requires certain injections at regular intervals, such as a diabetic, may receive such injections on Shabbat, as well. There are additional grounds to be lenient with taking medications on Shabbat when the medication is in suppository form or drops. Children, certainly up to the age of nine, may take medicine on Shabbat without restriction. Those who require sleeping pills in order to sleep are permitted to take them on Shabbat.
Closely related to the ban against taking medication on Shabbat is the ban against exercising on Shabbat. This is because the prohibition against taking medicine on Shabbat includes a ban on any treatment or procedure that often includes the use of medication, even if no medication is actually being used. One such example is that of sweating. It was once believed that sweating was a remedy for many illnesses. When sweating was prescribed, it would be induced by either medication or exercise. Therefore, although exercise today is essentially unrelated to medication, the sweating that results from exercise is deemed to be reminiscent of the ancient practice of sweating through medication, rendering it forbidden. This is true even if one has no intention of breaking out in a sweat.
According to most authorities, it is forbidden to take medicine on the first day of Yom Tov just as it is forbidden to take medicine on Shabbat. Nevertheless, in a situation of great need or distress, one may be lenient and take medicine on the first day of Yom Tov. It is argued that since it is permitted to grind food on Yom Tov, medicine should not be forbidden due to the concern for grinding on Shabbat, as mentioned above. According to this approach, medicine is similar enough to food to allow using it in any way on Yom Tov. On the second day of Yom Tov there is no prohibition against taking medicine whatsoever, and one is permitted to take any type of medicine for any type of ailment on the second day of Yom Tov. It follows, of course, that one may take medicine on Chol Hamoed.
 Shabbat 52b, 11a; Rashi, Shabbat 53b; OC 328:1; Mishna Berura 327:1.
 Rambam, Hilchot Mamrim 2:2. See Igrot Moshe, OC 2:100.
 Igrot Moshe, OC 2:100.
 Ketzot Hashulchan 134:7. See also Igrot Moshe, OC 2:100; Tzitz Eliezer 8:15:15:1,4; Torah Chessed (Fradkin), OC 17:6.
 See: Pitchei Teshuva, EH 13:4, 9; Igrot Moshe, OC 2:100.
 See Minchat Shabbat 91:9; Ketzot Hashulchan 134:7; Chelkat Yaakov 4:41; Tzitz Eliezer 8:15:15; Minchat Yitzchak 3:35; Yalkut Yosef 328:52.
 Mishna Berura 328:8.
 Tzitz Eliezer 8:15:15.
 OC 328:17, 37; Mishna Berura ad. loc.
 Be'er Moshe 1:33; She’arim Hametzuyanim Behalacha 91:3.
 OC 328:1.
 Shabbat 109b; OC 328:37; Aruch Hashulchan 328:48; Mishna Berura 328:117,118; Rivevot Ephraim 1:222:8.
 Igrot Moshe, OC 3:54; Shemirat Shabbat K'hilchata 34 note 85; Tzitz Eliezer 14:50; Az Nidberu 6:72; Shulchan Shlomo 328:58; Emek Halacha 1:23,24.
 Minchat Shabbat 91:9; Shemirat Shabbats K'hilchata 34 note 76; Kovetz Teshuvot, OC 40; Rivevot Ephraim 3:221:1, 3:227. But see Igrot Moshe, OC 3:53.
 Shemirat Shabbat Kehilchata 33:4.
 OC 328:37; Tzitz Eliezer 11:37; Minchat Shabbat 92:32. But see Magen Avraham 382:43; Igrot Moshe, OC 3:54; Mishna Berura 328:121.
 OC 328:23, 27; Shemirat Shabbat K'hilchata 35 note 17. See also Igrot Moshe, OC 3:54.
 Shemirat Shabbat K'hilchata 20:4; Rivevot Ephraim 3:231.
 Rivevot Ephraim 1:222:10.
 Rivevot Ephraim 6:187:1.
 Rema, OC 328:17; Chazon Ish, OC 59:4; Nishmat Avraham 328:54;Tzitz Eliezer 8:15-12; Minchat Yitzchak 1:78.
 Mishne Halachot 4:51.
 Rambam, Hilchot Shabbat 21:28; Mishna Berura 328:130.
 Mishna Berura 328:130.
 Chayei Adam 103:1; Kitzur Shulchan Aruch 98:33; Mishna Berura 532:5; Mishne Halachot 5:76; Shemirat Shabbat K’hilchata 33:24.
 Chazon Ovadia, Yom Tov, p. 23; Tzitz Eliezer 8:15:16.
 OC 496:2; Mishna Berura 496:5.
 OC 532:2.