So, someone posted a meme that involved a D&D party crossing a mountain pass in a blizzard, and the dwarf critically failed his climb check. When the GM asked the player what he was doing, the player responded 'my character is going to flap his arms and pray', and two critical successes later the GM was all '... you see your dwarf somehow staying level by flapping his arms'. Which is a hilarious example of luck, but the first bit was probably in the examples of 'how NOT to handle failure'. (Well, to be fair, the GM was probably expecting the dwarf to try to catch himself or something.)
Basically, in gaming, you generally want character deaths to be proactive and cause some kind of emotion at the table (either feel meaningful or hilarious). Dying after one bad dice roll on a climb check isn't meaningful. Dying after you fall onto a narrow ledge, and the party's attempts to save you fails is slightly more because it means you chose it. Heck, dying because you found something important on that ledge and needed to make sure your friends got the thing, even at the cost of your own life is the sort of thing that makes the GM bust out the roleplaying rewards (transferred over to your next character).
I just think of the last game session I was in. My character, Rowan was bit by a were-spider and her dreams were turning from anxiety dreams to 'I suspect the next full moon is going to start with me growing extra legs'. Another character (Bri) was hit by mummy rot (a curse carried by mummies) on the way to getting my character (and various other victims) back to civilization. (The GM had to fudge the rules a bit for the mummy rot, as a D&D edition change made it a tad more lethal than he'd assumed.) This meant that not only did we have to race back to civilization before Bri died (Rowan had a slightly longer timetable), but we now owed the local cleric a favor for curing the party, and we had to make a trip for him. So, even if we had bad luck on saving throws, it was less about death and more about the risk of death and furthering the plot.