Entirely depends on the show and the death. As long as it matches the tone of the show and makes sense and isn't gratuitous, it's fine. I'm upset, but it's fine.
On the ok end:
Some of my favourite characters have died within fifteen minutes of the first episode and I scold myself for missing the obvious death flags.
Lots of shonen and magical girl anime will kill off, or something equivalent too, a lot of the cast in the run up to the final battle, which is predictable and you know will come back so that never bothers me, if just more annoying that it's ridiculously predictable and rarely done well.
On the not ok end:
Certain other shows will rarely kill a character, but fake it constantly to the point where I don't actually believe them anymore when a named characters falls to certain death or is blown up or even cut in half on national television in a hostage situation. No one dies, And so if then my favourite character ends up being one of the few who actually dies and isn't a fake out, I'll be pissed.
Another certain show killed off my favourite character in a heart wrenching way, a lost student looking to his teacher for guidance was shrugged off and basically told "this is why I could never teach you you're just not right" and the student ended up committing suicide in front of his teacher. You'd expect this to be some impactful moment when he realised he needed to change and wasn't perfect but instead the very next episode it was like it never happened and he was still the best teacher in the world. I dropped it then and there.
And finally, the most annoying that I would have dropped were it not the finale episode anyway: there was a popularity pole take between seasons. Coincidentally, the characters who died in the finale were all the main or secondary characters outside the top 5. Fine, this would be fine, if the show had made certain characters to be popular and it worked. The problem came when we realised not only were they just the characters outside the top 5 most popular, the died in order of their ranking on the pole. The only exception was a character ranked about 7th who died in episode 6 of season 2 at the start of an aborted arc, making it very clear this finale was rushed and not planned at all.