I’m so glad you wrote. this makes sense to me. You are miserable at school. You are missing your family. You get frightened that they won’t be there for your whole life when you need them. So, yes, your preoccupation with death makes a kind of sense.
However, your preoccupation with death isn’t helping you solve the problem — which is that you are miserable at school. You didn’t share whether the school is the wrong school for you or if you generally have difficulty being away from your family. The answer to that would direct how one would go about helping you solve the problem.
Please make an appointment with a school counselor to help you figure it out.
You might find it helpful to read this article: Help! I’m in the Wrong College
I wish you well.
Why Do I Obsess about Depressing Thoughts?