I’ve killed off characters often, despite how attached I get to them. It’s often literally painful for me, but if it’s necessary for the story, I’m ruthless about it. I take Stephen King’s advice: “kill your darlings, kill your darlings, even when it breaks your egocentric little scribbler’s heart, kill your darlings.”
(Which is, of course, Mr. King quoting William Faulkner: “In writing, you must kill all your darlings” who was in turn quoting Arthur Quiller-Couch: “If you here require a practical rule of me, I will present you with this: ‘Whenever you feel an impulse to perpetrate a piece of exceptionally fine writing, obey it—whole-heartedly—and delete it before sending your manuscript to press. Murder your darlings.” Sort of a stretch to interpret that as killing off one’s characters, but there we are. )