
If a person suffers from a serious illness one is permitted to violate the Sabbath to heal him, for the saving of lives supercedes the Sabbath. The Talmudic sages discussed at length which illnesses are considered dangerous and can prompt Sabbath violation and which are not dangerous and do not warrant Sabbath violation. Thus, for example, they discussed eye problems. One sage argued that if a person suffers such bad eye trouble that it appears the eye will come out of its socket he may spread ointment on the eye to heal it. At first the scholars thought that one may spread an ointment which had been prepared before the Sabbath but that one was forbidden to prepare the ointment on the Sabbath itself and carry it from place to place within the public domain because that would violate the Sabbath. One of the sages, Rabbi Jacob, thought that one was even permitted to prepare the ointment on the Sabbath and carry it in the public domain to spread it on the patient’s eye. A different sage, Rav Samuel son of Judah, forbade violating the Sabbath to heal a sick eye. One day Rav Samuel son of Judah fell ill with eye problems on the Sabbath. He went to ask the permitting sage, Rabbi Jacob, whether one was permitted to violate the Sabbath to heal a sick eye. He was answered: Everyone is permitted but you are forbidden, because you taught that it is forbidden. He said: I did not issue the prohibition on my own authority but on the authority of the sage Samuel! How did I know that the sage Samuel prohibited it? Because he had a maid who got a serious eye infection on the Sabbath. She was screaming with pain but no one helped her because of the sanctity of the Sabbath. In the end she died.
The next day, in the synagogue the sage Samuel spoke about the death of the maid and said that one is permitted to violate the Sabbath for a person with eye problems, for it is a danger to life.
(Babylonian Talmud, Tractate Avodah Zarah 28b)