@stargirl-3213
Definitely don't do it for shock factor. There has to be a reason behind their death. For example, Beth in Little Women and Beth from the Last Light series. (haha i chose two beths) They were killed off to help motivate/inspire other characters. Be careful, though. As an empath, reading scenes like this are especially hard. I find that the saddest way to kill them off is to leave a goal unaccomplished or something similar.
Another tactic I use is to make the character lovable. I naturally get wayyyyy to emotionally attached to characters, but the more loveable, the more likely the reader is to get attached. And if you're writing it this way, make their death unexpected. I think hallucinations would be a pretty intense/sad way to go if you're looking for that. I don't know, just a bunch of my random thoughts on this. XD Good luck writing!