Live By Them
(ה) וּשְׁמַרְתֶּ֤ם אֶת־חֻקֹּתַי֙ וְאֶת־מִשְׁפָּטַ֔י אֲשֶׁ֨ר יַעֲשֶׂ֥ה אֹתָ֛ם הָאָדָ֖ם וָחַ֣י בָּהֶ֑ם אֲנִ֖י יְהֹוָֽה׃ {ס}
(5) You shall keep My laws and My rules, by the pursuit of which man shall live: I am the LORD.

To give some context for the following source from the Talmud, there had previously been a series of prooftexts for why saving a life would be uplifted above other mitzvot, but each prooftext had a dissenting opinion, or refutation. Shmuel’s argument, in bringing Vayikra/Leviticus 18:5 as a prooftext, was too strong to refute.

וְכוּלְּהוּ אַשְׁכְּחַן וַדַּאי, סָפֵק מְנָא לַן? וְדִשְׁמוּאֵל, וַדַּאי לֵית לֵיהּ פִּירְכָא. אָמַר רָבִינָא וְאִיתֵּימָא רַב נַחְמָן בַּר יִצְחָק: טָבָא חֲדָא פִּלְפַּלְתָּא חֲרִיפָא מִמְּלָא צַנָּא דְקָרֵי.
And for all the other arguments as well, we have found proofs for saving a life from certain danger. But for cases of uncertainty, from where do we derive this? For this reason, all the arguments are refuted. However, the proof that Shmuel brought from the verse: “And live by them,” which teaches that one should not even put a life in possible danger to observe mitzvot, there is certainly no refutation. Ravina said, and some say it was Rav Naḥman bar Yitzḥak who said with regard to this superior proof of Shmuel: One spicy pepper is better than a whole basket of squash, since its flavor is more powerful than all the others.
חולה שהצום עלול לגרום למותו, מצווה שישתה ויאכל לפי צורכו, מפני שפיקוח נפש דוחה את מצוות התענית כמו את שאר המצוות שבתורה, שנאמר (ויקרא יח, ה): "וּשְׁמַרְתֶּם אֶת חֻקֹּתַי וְאֶת מִשְׁפָּטַי אֲשֶׁר יַעֲשֶׂה אֹתָם הָאָדָם וָחַי בָּהֶם אֲנִי ה'". דרשו חכמים (יומא פה, ב): "וָחַי בָּהֶם ולא שימות בהם", שמצוות התורה נתנו כדי שיחיו בהם, ולא שימותו על ידי קיומן (פנה"ל שבת כז, א, 1). והנמצא בספק סכנה ומחמיר על עצמו שלא לשתות ולאכול – חוטא, מפני שעבר על מצוות התורה לשמור את נפשו, ועליו נאמר (בראשית ט, ה): "וְאַךְ אֶת דִּמְכֶם לְנַפְשֹׁתֵיכֶם אֶדְרֹשׁ" (ב"ק צא, ב).
Someone for whom fasting is liable to cause death has a mitzva to eat and drink as needed, since saving life overrides the mitzva of fasting – and all mitzvot in the Torah – as we read, “You shall keep My laws and My rules, by the pursuit of which man shall live; I am the Lord” (Vayikra 18:5). Our Sages infer: “‘By which man shall live’ – and not die” (Yoma 85b). The mitzvot were given to promote life, not to cause death (Peninei Halakha: Shabbat 27:1 n. 1). If one is uncertain whether his life is in danger but is “stringent” and does not eat and drink, he is a sinner, as he violated the Torah’s commandment to preserve his life. Of him, the Torah says (Bereishit 9:5), “But for your own life-blood I will require a reckoning” (Bava Kama 91b).