Human nature question around the "greater good". If you could save 1 life by dying yourself, would you? If you saved 2? 10? 100? What would be the number of lives that could tip you toward that level of self sacrifice?
What about you @Seeker3CO ? what is your magic number?
I'm afraid my altruism doesn't stretch that far. I won't be laying down my life for a million strangers. The world would do very well by culling a few anyway. I would lay down my life for any of my sons however.
I'd take a bullet for people who are a significant part of my daily life, such as my wife and stepson. That makes sense, as it's how you can predict the intensity of grief: if someone dies who is deeply involved with you, then that's a loss; if they aren't, then not so much. It follows, then, that you'll make sacrifices in proportion to the value the person has to you.
There are some special exceptions, such as biological children. My son was, for all practical purposes, a recluse, but I worried about him, cared about him, and would have given my life in exchange for his if I somehow could have. There's a special-case bond there, for most of us, I think.
That may sound selfish, but it's how it actually works, and I don't think it's anything to be ashamed of. It's how natural selection has fitted us as hypersocial creatures.
Anyone who says they would give up their life for a total stranger is, generally, spouting self-flattering idealistic BS. Although, people have done it on occasion, on the impulse of the moment, because of a burst of compassion / empathy in an emergency situation, I don't see it as the rule or even as an intelligent strategy. But because I'm a compassionate person, if I saw, say, a small child wandering the freeway I would likely risk my life to save it if I thought I could. But that would be my empathy overriding my rational mind, and it's at best a tossup that such an act of self-sacrifice would be a net positive for the world as a whole. I mean, after all, it's some random kid, who may grow up to be a total ungrateful asshat, and now I'm not there to provide for my family anymore. How would that make sense? Might be noble, in the abstract, but my wife would still be a widow as a result.
Absent any context, such a thought exercise is not possible to answer, in my opinion. One can never know how heroic or cowardly one would be until thrust into a situation where a life and death decision must be made.