Self-sacrifice in Jewish law
Self-sacrifice is required in Jewish law for rare yet specifically defined circumstances, in which a Jew is expected to sacrifice their own life rather than violate a religious prohibition. The core principle of self-sacrifice, yehareg ve'al ya'avor ("let him be killed rather than transgress"), is enunciated in a Talmudic sugya (pericope) at Sanhedrin 74a-b and thereafter typically discussed in terms of three cardinal or exceptional prohibitions.
Source: Wikipedia — Self-sacrifice in Jewish law (CC BY-SA 4.0)