I would try hard not to have the party killed off - if it looks like it might happen, maybe try to weaken
the monsters, or play the monsters stupidly to give the heroes an advantage.
Sometimes, it just can't be helped - and of course, there is a much greater chance of a single hero dying
and the rest making their escape.
In the case of the whole party - have the players make new heroes, beef them up a bit, and wade back in,
possibly even allowing them to find the belongings of those who fell before, giving a little bonus for sticking
with the game, even after such tragic losses.
If it is just one hero who died - perhaps have a nice role-playing portion where the other heroes seek out a
new member of their party...perhaps having to explain why they need a new member of their party. Could be
fun. Just have the Player of the dead hero make a new character, pretty much the same as the dead one...maybe
with a bit different personality and equipment make up. You know...if it is a wizard or elf, maybe he will have
different spells from the dead hero...something like that.
Oh...and a different name, of course.