This article may be somewhat controversial because a lot of Game Masters ("GM") may disagree with it. They see themselves as adversaries to the Player Characters ("PC"), and killing them off is fair play. For example, I saw a post on another RPG site by a GM who was announcing ahead of time that he was going to total party kill ("TPK") his party that night, and asking for input. Let me say this: in my 30+ years of game mastering, I have only had three TPKs, and all of them were totally accidental on my part. And even when one PC gets killed, I usually make it easy for them to get a Raise Dead spell and get back into the campaign.
Does this make me a pushover? I don't think so. I just don't consider it my goal to kill off PCs, because they are an important part of the story I am trying to tell, and to the players, the PCs are the most important part of the story - far more important than all the background story and NPC bios you make up when no one else is around.
The hard reality is, Mr. GM, the players might not even know anything about who's king of your kingdom, who's the god of storms and lightning, who fell in love with who at the last ball, but they will know every last detail about what their PCs are doing, what they have done, and will brag about their heroic deeds to each other while you're in the other room mapping more of the dungeon.
But I thought it was an unfair death, so I allowed Xelsior Barwind to return, and to reward him for his faithfulness to good, a good goddess named Medea rewarded him by reincarnating him as an aasimar paladin, and giving him powerful magic items, including a Holy Sword. But that wasn't the end of the tale. Xelsior Barwind was captured in battle by Queen Anne, and tortured and eventually crucified, but he would not serve her. He was rescued and nursed back to health, but no longer had his powerful magic items. So THEN, he went back to Queen Anne, and agreed to serve her, and to prove his loyalty he did a terrible deed, and got most of his magic items back.
The other players learned of this, so they killed Xelsior Barwind a second time, this time for being evil.
But I gave Xelsior Barwind a second chance, Medea brought him back to life again, but this time he was under penance not to wear armor of any kind or use any magic items other than his Holy Sword. He helped kill a dragon (which you can make up with Scabard's Dragon Name Generator), but got killed in the process, and having redeemed himself with great bravery, Medea revived him a third time, this time with the penance lifted.
You might think I was too easy on the player playing Xelsior Barwind, but I think I was making the game fun for him. He was really attached to this PC, and because I kept giving him second and third chances, he kept playing in my campaign.