The Good Samaritan
One is not permitted to stand idly by when one sees another person in grave personal danger. As the Rambam writes:
One who is able to save another person but does not is in violation of the commandment "Do not stand idly by your neighbor's blood….[1]If one sees someone drowning in the sea or being attacked by bandits or wild animals and is able to rescue him by himself or with the assistance of others but does not is [also] in violation of the commandment "Do not stand idly by your neighbors blood"….One who destroys the life of a single Jew is regarded as though he destroyed an entire world and one who saves the life of a single Jew is regarded as though he saved an entire world.[2]
Saving another person's life is also considered a component of the mitzva of hashavat aveida, returning a lost object, as saving someone's life is essentially returning his life to him anew as if it had been lost.[3]
Although one is required to make heroic efforts[4] to assist a person who is in danger, one is not required, and indeed not permitted, to risk one's life.[5] A classic application of this principle is "the feeble onlooker is not required to jump into the water and save a heavy man who is drowning". This is because, of course, there is considerable risk that the rescuer himself might drown.[6] Although there is no obligation to risk even a non-vital limb in order to save another person's life, it is praiseworthy to do so.[7]
One who rescues someone is to be reimbursed for all expenses incurred in the course of the rescue, including time lost from work.[8] Similarly, one is permitted to save oneself even if it means stealing or damaging another person's property but one is required to compensate the owner for such damages.[9] As such, one who is taken captive and later redeemed through a collection of community funds is obligated to reimburse the donors.[10]
It goes without saying that one is permitted to violate the Shabbat or any other Torah law in order to save the life of another person, with the exception of violating the prohibitions of murder, idolatry, and immorality.[11] Indeed, the quicker one acts the more deserving of praise he is. If one feels that another person is truly trying to kill him then it is permitted to go ahead and kill that person preemptively.[12]
[1] Vayikra 19:16.
[2] Rambam, Hilchot Rotzeiach 1:14, 16.
[3] Sanhedrin 73a.
[4] Rashi, Sanhedrin 73a.
[5] Yoma 82b; Sanhedrin 74a; Bava Metzia 62a.
[6] Sema, CM 426:2; Maharam Schik, YD 155; Sefer Chassidim 674.
[7] Radbaz 3:1053.
[8] CM 267:26.
[9] OC 359:4.
[10] Maharam Mirottenberg 4:39.
[11] Yoma 84b.
[12] Sanhedrin 72a.