Players throughout RPG history have had to face the sad fact that characters can die.
In the early days of Dungeons & Dragons, character creation was simply a matter of rolling 3d6 half a dozen times and picking a name and class. When a character died at a low level, you just rolled up a new one and carried on. Death at a high level was a more serious matter, though, as high level characters had months or years of real time invested in their development. Throwing a low level character into an ongoing high level campaign, too, would be a bad idea.
So how do we handle this aspect of role playing games? It depends partly on how
Pay For Resurrection
If the game world has easily accessible resurrection, the other characters can simply pay to have your character returned to life. The disadvantage of this is the delay in getting your character's body to where the resurrection will happen, so you'll be sitting out some of the game. But you get your normal character back, mostly intact.
Just be sure you know whether you're getting resurrection or reincarnation, though!
In a campaign where magic abounds, characters can use some of the wealth they're always accumulating to buy magical insurance. This might take the form of an amulet that restores full health on the instant that a character would otherwise die, or one that would teleport them to safety, etc. These will typically be one-use items, but can give a character a second chance.
Be Fruitful And Multiply
Characters can always start a family, and train their children in their footsteps. This amounts, from a player's perspective, to designing their character's own heirs. Part of their wealth can be put into housing, educating, and outfitting these heirs.
When the heir apparent receives word of their parent's death, they can then venture out into the world to take up the good fight (e.g. become a player character).
If your GM lets you get away with it, use magical character diaries so that the heirs know as much about what is happening to the character as the character does. That way they're prepared to jump into the campaign from the instant of their parent's death.
Take Over An NPC
If your GM isn't so
Regardless of how you handle the death of a character in an ongoing campaign, it's important to focus on the campaign itself. Even if your character and all their knowledge is gone, you can still participate in the campaign itself, which is why you're playing.
You never know, your GM might be feeling evil, and allow you to play the villain of the piece.