May I take my medication on Shabbos?
The issur (restriction) of taking medication on Shabbos* is a g’zeirah mi’d’rabbanan (a Rabbinic decree) instituted as a safeguard to prevent a person desperate for a cure from grinding herbs to produce medicines, which would violate the melachah (Biblically prohibited work on Shabbos) of tochein (grinding vegetable matter). (Today, when it is common to acquire our medications pre-ground from the pharmacy, the original reason for this g’zeirah doesn't usually apply. Why we still maintain it and to what extent is extensively discussed among poskim.)
A choleh sheyesh bo sakanah (a critically ill person) may obviously use any medical interventions on Shabbos, including grinding medications which is assur min HaTorah (forbidden by Biblical Law)—because pikuach nefesh docheh Shabbos (saving a person’s life overrides Shabbos observance). A choleh she’ein bo sakanah (an ill individual with a non-life threatening condition)—a category which includes the basic needs of very young children— may take medication, as well as other leniencies (as discussed in Halachah #167).
Someone who is suffering from a localized, non-threatening medical issue does not fit in either category—the general threshold of choleh being someone who is ill enough to be bed-ridden or otherwise debilitated. Taking medication on Shabbos under such circumstances is a halachic issue. If it is not possible to simply skip one day’s dose, an eitzah (suggestion) is to take it right before Shabbos and immediately after.
Sometimes, the medication must be taken at a certain time of day or in two or more doses within a twenty-four hour period, and the above eitzah is no help. If the medication has been taken for some time prior to Shabbos, there is a heter (dispensation) in such a case—according to many poskim—to continue taking it over Shabbos. There is certainly room for leniency in circumstances where interrupting the course of the medication would be a setback in its effectiveness or necessitate another treatment round altogether.
*This issur is in force, according to most poskim, on both days of Rosh Hashanah and the first day of every other Yom Tov. (This is because the second day of Yom Tov is in itself Rabbinically instituted and many of their restrictions are dealt with more leniently.)
According to many opinions, painkillers are not included in the g’zeirah and may be taken on Shabbos, and certainly on Yom Tov, since they dull pain but don’t treat it.