If you cannot save him without sacrificing yourself – save yourself.
there is no obligation for a person to save another’s life at the expense of his own. As it is written: ” Your brother should live with you’ ” your life comes first.
see Rabbi Akiva here
In Jewish law, there is a biblical obligation to save lives.
The Biblical verse “You may not stand idly by your neighbours blood”
(Leviticus 19:15) is understood by the Talmud to be an obligation to save people from danger (Sanhedrin 73a).
However, it is necessary to define the parameters of this obligation. Does the bystander have to endanger himself to save the victim? Does the bystander have to spend money to save the victim’s life?