Ask yourself: How many characters have you killed? Did those deaths benefit the plot in any way? If the answer is “no”, you shouldn’t be killing them.
Killing a character should be an event that drives the plot to new heights. In my favourite fantasy novel, Shadowmarch, the death of a character very early in the story drives the main characters to take on far more than they can chew (at first). Then there are other books where character deaths just occur to make you sad or–my personal pet peeve–to create “shock value”. Shock value may work at first, but it gets old pretty fast.
No, the death of a major (or even minor character) should be written to push your story forward. There’s no sense mentioning a death unless it affects the plot; otherwise I’d consider it to be something that needs to be cut.
How would removing this character affect the story? Would the hero struggle? Would it spark a war? Would the business collapse without them? Would someone be in danger if this person died? These are examples of questions you should be asking yourself when deciding to kill off a character.
There’s also the question of whether or not the reader will react emotionally to the death you’re planning out. If it’s a main character you’re offing, you want this death to spark something in the reader. If the reader feels nothing, then your character is flat and needs work (or the reader might not have a heart; it’s probably best you ask several readers to make sure.)
It’s difficult for some writers to kill a character (myself included, though I’ve been known to destroy a few lives in the past). Yet if the death of a character is the best way to create the plot you imagined for your story, it’s necessary to… er… take care of it.
Moving the plot along isn’t the only reason to kill a character. You may find while reading through your story that some characters are actually slowing the plot. If that’s the case, find a way to remove them. I know it seems harsh to do something like that to one of your characters, but if they aren’t bringing anything to the table then they can’t sit at it (fair is fair, right?). You might love that particular character, but a reader might give up on the story because of them.
Every character must be vital to the storyline, and when they become irrelevant–off with their heads!