Micah 7:9
But there is no small danger of the mind falling into the error of supposing that every illness needs the aid of medicine. For not all illnesses come naturally, or from errors of diet or any other bodily causes, for which we see that the medical art is sometimes useful. For often illnesses are scourges of sins, sent to convert us. “For whom the Lord loveth, he chasteneth.” And “For this cause many among you are weak and sickly, and not a few sleep. For if we discerned ourselves, we should not be judged. But when we are judged, we are chastened of the Lord, that we should not be condemned with ...the world.” In such cases then we ought to be quiet and forbear medical treatment, and endure what comes upon us, when we have recognised our sins, as (Micah) said: “I will bear the indignation of the Lord, for I have sinned against him”; and we ought to show amendment by doing works worthy of repentance and remembering the Lord’s words: “Behold, thou art made whole; sin no more, lest a worse thing befall thee.”
Source: The Longer Rules, Question 55