From the shiurim of Rabbi Elchanan Peretz shlita on the laws of Shabbos and medicine
It is permitted to take sleeping pills and Ritalin on Shabbos, since they are not meant to heal an illness or a wound in the body but rather to regulate functioning or sleep.
The answers were compiled from the shiurim of Rabbi Elchanan Peretz shlita and from rulings he received from HaGaon Rabbi Chaim Pinchas Scheinberg zt”l and from leading poskim, and are for study purposes only. One may not rely on what is stated here for practical halachic ruling; for a personal question, one should consult a rav or a Beit Horaah.