Among the Berachos which Hashem says He will bestow upon the Jewish people if we will observe the Mitzvos properly is that He will keep His sanctuary in our midst and that He will not reject us (ויקרא כ"ו:י"א). The Ramban, in his commentary on that Posuk (שם), asserts that all of the Berachos described here as coming as a result of the people's observance of the Mitzvos are miracles, albeit hidden ones, which come about through natural events. He then explains that in general, when the Jewish people behave properly, their affairs are not carried out by means of the natural order of things, but rather through the direct blessing of Hashem; consequently, he adds, the people then will not have to go to a physician or follow a medical course of action upon taking ill, because Hashem alone is the true healer. He then points out that the Tzaddikim of the past, during the era when prophecy existed, indeed did not turn to doctors when they were sick, but rather to prophets, and he brings a proof to this idea from the fact that the Posuk in Divrei HaYomim Beis (ט"ז:י"ב) takes note of the idea, apparently as a form of rebuke, as explained by the Metzudas Dovid (שם בד"ה כי), that Asa (the king of Yehudah) consulted physicians when he was ill, instead of Hashem, implying that going to doctors was not customary then. He then brings another proof concerning a righteous person who did not need any doctors, but was rather protected directly by Hashem, and he cites a statement in the Midrash in Shir HaShirim Rabbah (פרשה ו' סימן י"ז) which indicates that only in a home where there are no Mitzvos is there a need for a physician.
The Gemara in Berachos (דף ס.) states that it is not really proper for people to pursue medical treatments, but that they have become accustomed to doing so; the Ramban (שם), after citing this statement, explains it to mean that had people not become accustomed to seeking medical treatments, a person would become sick only based upon the punishment he would deserve for his sin, and he would then be healed by the will of Hashem, but because people have accustomed themselves to obtaining medical treatments, Hashem leaves them subject to the course of nature. The Ramban (שם) then cites the phrase "ורפא ירפא," "and he shall cause him to be healed," from a Posuk earlier in the Torah (שמות כ"א:י"ט), along with the interpretation of this phrase in the Gemara in Bava Kamma (דף פ"ה.) which teaches that the intent of the phrase is to inform us that permission has been given to a doctor to provide medical care, and he notes that the Gemara (שם) does not say that permission has been given to a sick person to be healed by a doctor, but rather that since the sick person has already come to the doctor to get healed, the doctor should not refrain from healing him for any reason. But the Ramban (שם) does say that such a person is not a part of the congregation of Hashem, and he says earlier there that doctors have no place in the home of those who fulfill the will of Hashem, because He has promised Himself to remove all sickness from our midst (עיין שמות כ"ג:כ"ה); the Ramban (שם) thus concludes that those whose ways please Hashem have no need for doctors. It would appear from these words of the Ramban (שם) that it is preferable that a sick person should not seek medical help from a doctor, but rather should rely solely on Hashem, since seeking such help from a doctor is what is done only by people who do not believe in Hashem's healing power; observant Jews, however, should not turn to doctors for medical help.
This position of the Ramban (שם), however, seems somewhat difficult to accept, and does not appear to reflect the opinion of the majority of authorities, although it is possible that the Tur (יורה דעה סימן של"ו) holds this way, as might the Perishah (שם אות ב') and perhaps the Bach (שם בד"ה ומ"ש שכן); Ibn Ezra, in his commentary on the Torah (שמות כ"א:י"ט בד"ה ורפא), writes that doctors have the right to treat only external wounds, but internal illnesses must be left to Hashem to heal, and he also cites the criticism of Asa mentioned above as a proof to this. The aforementioned Gemara in Berachos (שם), though, quoted by the Ramban (שם), after presenting one view which indeed does seem to indicate that it would be better for people not to try and obtain medical treatment upon taking ill, as explained by Rashi (שם בד"ה שאין), does go on to present another view which implies that a sick person should be encouraged to seek medical help. It appears according to this second view that the phrase "ורפא ירפא" in the Posuk cited above (שמות שם), which is interpreted by this Gemara (שם) as it is in the Gemara in Bava Kamma quoted above (שם) to mean that a doctor has been given permission to provide medical care, also implies that a patient should seek out medical care since the Torah (שם) has given specific consent for the providing of such care. An earlier Gemara in Berachos (דף ה:) relates that a certain Amora once cured a fellow Amora, apparently at the latter's request, which suggests that it is certainly permissible for a sick person to seek medical help, although that particular case may not have been one where conventional medical treatment was given. The Gemara earlier in Bava Kamma (דף מ"ו:), however, states that simple logic dictates that someone who is in pain should consult a physician, while the Gemara in Gittin (דף נ"ו:) relates that at a very critical moment in Jewish history, Rabbi Yochanan Ben Zakai made sure to arrange for a doctor to provide medical care for a certain Tzaddik who was ill; the Gemara in Bava Metzia (דף פ"ה:-פ"ו.) indicates that Rebbe (Rabbi Yehudah HaNassi, compiler of the Mishnah) had his own private physician, and the Gemara in Kesubos (דף ע"ה.) also speaks of a person going to a doctor to have a certain physical ailment cured.
The Gemara in Bava Kamma mentioned above (דף פ"ה.) discusses at some length the idea of going to a physician in a case of one who has experienced bodily injury, implying that one should follow the instructions of one's doctor, stating that a physician who heals for nothing is worth nothing, and, apparently, urging one to seek out a physician who is nearby to avoid the possibility of the injury getting worse, and indeed to seek out a qualified physician and not to try and cure oneself alone; some of these ideas are codified, in the context in which they are discussed in the Gemara (שם), by the Rambam (פרק ב' מהל' חובל ומזיק הלכה י"ז-י"ט) and by the Shulchan Aruch (חושן משפט סימן ת"כ סעיף כ'-כ"ב). The Gemara in Yoma (דף פ"ג:) indicates that one who is dangerously ill may call a doctor even on Shabbos, even if this will lead to violations of Shabbos, and the Rambam (פרק ב' מהל' שבת הלכה א') rules accordingly; the Shulchan Aruch (אורח חיים סימן שכ"ח סעיף י') also assumes that doctors are consulted and are obviously present when making medical decisions. All of these sources, then, seem to indicate that an individual is permitted, and perhaps required, to seek the medical attention of a physician when he is ill; the Gemara in Sanhedrin (דף י"ז:) indeed states that a Talmid Chochom should not live in a city which has no doctor, and the Rambam (פרק ד' מהל' דעות הלכה כ"ג) rules this way as well . Although Rashi (שם בד"ה רופא) states that the "doctor" referred to here is actually a Mohel, who is needed in order to circumcise any boys who are born, it appears from the Rambam (שם), especially in light of what he writes in the previous paragraph (שם הלכה כ"ב), that he understands that the "doctor" here refers to a physician. No self-respecting town, then, should be without at least one doctor, that people must be trained to consult.
The Gemara in Kesubos (דף י"ט.) stresses the importance of פיקוח נפש, saving a life, indicating that doing so takes precedence over anything else except for the prohibitions against worshipping idols, committing adultery, and committing murder. In a similar vein, the Gemara in Pesachim (דף כ"ה.-כ"ה:) states that one may do anything and use anything (עיין שם ברשי ד"ה בכל) for the sake of healing a dangerous illness unless it involves one of those three sins; the Rambam (פרק ה' מהל' יסודי התורה הלכה ו') and the Shulchan Aruch (יורה דעה סימן קנ"ה סעיף ג') rule accordingly. The Mishnah in Yoma (דף פ"ג.) presents examples of activities which are normally forbidden, whether in general or on Shabbos, that may be done in order to save a person's life, and the Gemara there (שם דף פ"ה:) concludes that this license to violate prohibitions in the Torah, or to ignore requirements imposed by the Torah, in order to save a life is derived from the Torah itself (עיין ויקרא י"ח:ה'). The Rambam (פרק ב' מהל' שבת הלכה א') rules that anything necessary to save the life of a dangerously ill patient may be done even on Shabbos, stressing that one must follow the directives of a competent doctor in the area, and he then adds (שם הלכה ג') that the laws of the Torah are designed to promote mercy, kindness, and peace in the world, concluding that anyone who refuses to violate Shabbos for the sake of a dangerously sick patient is a heretic. The Shulchan Aruch (שם סעיף ב') rules similarly that it is a Mitzvah to violate Shabbos for the sake of a dangerously ill person, and it is indeed praiseworthy to be diligent about this. An earlier Mishnah in Yoma דף פ"ב.() states that one who is sick may be fed on Yom Kippur based on the advice of experts, which Rashi שם בד"ה ע"פ() explains means based on the advice of two physicians who believe that this patient will be in danger if he will not eat; the Gemara later שם דף פ"ג.() adds that even if the patient feels that he need not eat, but the doctor feels that he must, we listen to the doctor. The Rambam פרק ב' מהל'( שביתת עשור הלכה ח') and the Shulchan Aruch שם סימן תרי"ח סעיף א'() rule accordingly, indicating that we disregard the patient's opinion that he need not eat if the expert doctors believe that he must. Based on the above, logic would dictate that if even Shabbos and Yom Kippur may be violated in order to treat a sick patient, then it is certainly the obligation of such a patient to seek such treatment whenever it is needed, since the preservation of life is obviously considered so important a value; the specific implication of the above is that the will of the patient who does not want to be treated can be ignored in the face of the opinion of the physicians who believe that he must be treated.
The Gemara in Berachos (דף מ.) and in Shabbos (דף קכ"ט.- קכ"ט:) and in Sotah (דף מ"ב: ועיין שם ברש"י בד"ה ליטרח) and in Gittin (דף ס"ט.-ס"ט:), among other places, offers certain tips as to how to remain healthy and avoid sickness, implying that it is the responsibility of every person to do so; the Rambam (פרק ג' מהל' דעות הלכה ג') writes that it is proper for a person to follow medical direction in order to strengthen himself and have a strong and healthy body so that he will be able to know Hashem, because it is impossible to understand His wisdom if one is not physically comfortable or healthy. The Rambam then reiterates this later (פרק ד' שם הלכה א') and adds that a person must avoid things which are detrimental to the body and accustom himself to things which heal and fortify it. It would thus seem that one must do whatever one can to keep oneself healthy and preserve one's own life. Indeed, the Ramban himself, despite the position presented above in his commentary on the Posuk in our Parsha (ויקרא כ"ו שם), writes in his Milchamos Hashem in Sanhedrin (דף י"ח. בדפי הרי"ף בד"ה אמר, באמצע הדיבור) that a dangerously ill person may not urge even that Shabbos should not be violated for treatment in his behalf, but must rather be diligent to even violate Shabbos for a medical emergency, and that if one refuses such treatment then, he is considered liable for his own death. The Ramban reinforces this same idea in his Sefer Toras HaAdam (שער המיחוש, ענין הסכנה, בד"ה ולענין), where he states that one who refuses medical treatment when the physicians have determined that he is in danger and must receive that treatment even if it involves violating Shabbos is considered like a murderer. The same idea is presented by, among others, the Ran in Yoma (דף ג: בדפי הרי"ף בד"ה חוץ) as well as by Rabbeinu Yonah (ספר איסור והיתר הארוך שער ס' סימן ח') who notes that a sick patient who wishes to be "strict" about Yom Kippur at the risk of his own life, against the will of the doctors, will be dealt with by Hashem, who punishes those who spill blood needlessly, as implied by a Posuk earlier in the Torah (בראשית ט':ה'); such a person violates the advice of Shlomo HaMelech in Koheles (ז':ט"ז) not to be "excessively righteous." It is worth noting that the Rambam, in his Peirush HaMishnayos in Pesachim (פרק ד' משנה ט'), implies, as part of an interesting discussion about the use of what might be termed unconventional therapy, that one should use natural and normal treatments to cure a sick patient, while the Rashba asserts (שו"ת הרשב"א חלק א' סוף סימן תתכ"ה) that the Ramban himself, who was also a doctor, did use certain unconventional methods to treat his patients. In any case, it seems clear from the above that there is an obligation upon a person to do what he must to keep healthy and to seek medical treatment when he is ill.
It must be pointed out, however, that the Avnei Neizer (שו"ת אבני נזר חלק חו"מ סימן קצ"ג) presents a Teshuvah from his father where he disagrees with the above, and, citing the aforementioned view of Ibn Ezra (שם) and of the Ramban in his commentary on the Posuk in our Parsha (שם), rules that a patient may be stringent upon himself and refuse medical treatment, and he suggests a proof to this from a Gemara in Bava Kamma (דף פ.); Rav Shlomo Kluger (שו"ת האלף לך שלמה חלק או"ח סימן שנ"א) also writes that a person who is in a potentially dangerous situation may be stringent upon himself and fast on Yom Kippur. In a different context, Rav Yonasan Eybeschutz writes (ספר כרתי ופלתי לשו"ע יו"ד סימן קפ"ח ס"ק ה') that we cannot rely on doctors in certain situations, and therefore their directives may sometimes be ignored. These views, however, seem to be in the minority, as most Poskim hold that one is required, and should indeed be forced, to accept medical treatment, even in violation of Shabbos and Yom Kippur and the like. The Radvaz (שו"ת הרדב"ז סימן אלף קל"ט, חלק ד' סימן ס"ז) rules clearly that one who refuses to have Shabbos violated in his behalf when the doctors have decided that his life is at risk is a חסיד שוטה, a pious idiot, and will be punished by Hashem because he is viewed as a murderer who is taking his own life. In a different Teshuvah (שם סימן תתפ"ה, חלק ג' סימן תמ"ד), the Radvaz discusses the story of the Riva (one of the Baalei HaTosafos), who took ill and refused to heed the advice of the doctors who told him that if he eats on Yom Kippur, he might survive, and then ultimately died from this illness; he explains the precise circumstances of that case and concludes that one may not learn from this conduct, but must rather obey the directives of the physicians.
The Magen Avraham (או"ח סימן שכ"ח ס"ק ו') and the Mishnah Berurah (שם ס"ק ו') accept this ruling, stating that one is to be forced to follow the directives of a qualified physician even against his will, as does the Kaf HaChaim (שם אות מ"ה), who cites many others who also accept this position. The Pri Megadim (באשל אברהם שם ס"ק ו') adds that to refuse medical treatment is an act of idiocy, especially since the Torah itself (דברים ד': ט"ו) warns that we must be very careful concerning our own lives. The Chovos HaLevavos (שער הבטחון פרק ד') writes that every person must do what he can to preserve his life and not simply say that he relies on Hashem, and he certainly may not expose himself to danger and put his life at risk for no reason, hoping to be saved by a miracle, because such a person is considered to be committing suicide. The Chida, in his Sefer Birkei Yosef (ליו"ד סימן של"ו ס"ק ב') writes similarly that today, we have no right to rely on miracles, and a sick person must thus follow the way of the world and seek out a doctor to heal him, because it is forbidden to do otherwise. HaRav Hershel Schachter (מאמר בענין "אליו הוא נושא את נפשו," נדפס בקובץ "בית יצחק" חוברת י"ח, תשמ"ו) explains that the Gemara in Bava Kamma (דף פ"ה.) cited above which states that the Torah has given permission to physicians to heal may be read to mean that since the Torah itself grants this permission, the permission of the patient is not needed. Rav Ovadyah Yosef (שו"ת יביע אומר חלק ד' חלק חו"מ סימן ו' אות ד', וכן בשו"ת יחוה דעת חלק א' סימן ס"א) asserts that this is unquestionably the majority position; he cites a Gemara in Avodah Zarah (דף נ"ה.) which implies that a doctor is needed to rid a person of an illness, and concludes that it is obligatory to seek the best possible physician and listen to what he says, because if one does not, he will be punished by Hashem for his behavior. It must be added, though, that the right to force a patient to undergo medical treatment exists only when the treatment is a proven, successful treatment, but if it is a questionable or experimental treatment, the patient may refuse it and place his faith in Hashem alone, as documented by Rav Yaakov Emden (ספר מור וקציעה לשו"ע או"ח שם בריש הסימן), among others, and discussed by the Sdei Chemed (אסיפת דינים, מערכת יום הכיפורים סימן ג' אות כ"ד); HaRav Hershel Schachter, in his essay referred to above (שם), goes in to some of the details of this, and this also seems to be the position of Rav Moshe Feinstein (שו"ת אגרות משה חו"מ חלק ב' סימן ע"ג אות ה', ועיין שם סימן ע"ד אות ב', וסימן ע"ה אות ג' ועוד).
As for the aforementioned position of the Ramban in his commentary on the Posuk in our Parsha (שם), where he suggests that it would be better to avoid seeking medical help from anyone but Hashem under any circumstances, the Taz (יו"ד שם ס"ק א') implies that this may be the case for people who are distinguished as Tzaddikim, and are thus free of illness and do not need human healing, but for the general population, including believing Jews, the Torah requires one to seek treatment in the natural way. It must be stressed, though, that even when one does consult with a physician, one must bear in mind that it is ultimately Hashem who heals him, a point emphasized by the Rashba (שו"ת הרשב"א חלק א' סימן תי"ג), among others, who says that one may rely on a doctor as long as he ultimately relies on Hashem, depending upon Him to heal him through the medium of this doctor, and this is what is allowed and indeed required. It is worth noting that the Bach, in his commentary on the Tur (יו"ד שם בד"ה תנא), seems to agree to this, because he explains that the sin of Asa, referred to by the Ramban (שם), was not that he consulted with physicians, but that he did so without displaying faith in Hashem at all, and he concludes that one may consult a doctor, as is customary, while placing his faith in Hashem. It is interesting that the Rambam (פרק י' מהל' ברכות הלכה כ"א), based upon the aforementioned Gemara in Berachos (שם), indicates that there is a Tefillah to recite when going to a doctor for a certain type of medical treatment, indicating that one's true faith is in Hashem; a similar Tefillah is cited by the Shulchan Aruch (או"ח סימן ר"ל סעיף ד'), and the Mishnah Berurah (שם ס"ק ו') adds that such a Tefillah should be recited before undergoing any medical procedure because it demonstrates that one's true faith is in Hashem alone.