When I was younger, I was like you describe. I'd lay awake nights kinda freaked out that I would die some day.
I remember looking up life expectancy and comforting myself that I had more than 75% or whatever left. When that wasn't enough, I'd think about how far away I was from graduation, and how, even after that, I'd have whatever-percent left.
I knew it didn't work that way, and it was irrational, but it helped me sleep, so I did it.
I'd absolutely panic if I had a fight with a family member at night and didn't have a chance to make up before bed -- what if I died before morning!
But, illnesses never scared me much.
Then one day.
One day, I was at the doctor's office, having a minor outpatient surgery performed. Very minor, local anesthetic only, procedure takes 10 minutes.
And the doc stuck me with the needle for the anesthetic, and it hurt just a little more than expected, and vasovagal reaction, and I fainted. Tunnel vision, echoing sound, sense of impending doom, blackness.
I was awake again before I finished falling back on the exam table, but I had a major panic attack. Never happened before in my life, but suddenly I was in an unimaginable blind panic, hyperventilating like mad, hands and feet starting to tingle and feel like they were vibrating.
Took two hours to calm down enough that they let me leave.
From that day on, anxiety attacks were a part of my life. For awhile, they were uncontrollable, and I started down the path that leads to agoraphobia. Before I locked myself in my dorm room forever, I got the anxiety just barely enough under control to keep living. I learned to talk about my anxiety very frankly with anyone who would stand still long enough to listen. This might be awkward oversharing, but it prevented me from getting stuck in the feedback loop that keeps people locked at home -- fear of the embarrassment of a panic attack being enough to start one.
I eventually learned to repeat my anxiety mantra aloud: "if every time I felt short of breath was really a heart attacks, I'd already have died long ago -- so these are not heart attacks"
Anyway, long story, but the result is that 20 years later, I rarely have attacks anymore, though I'm still a bit of an anxious soul. I don't often have that existential angst that used to lead me to count lifespans as a teen.
But I do get massively panicky when I'm sick, now.
I'm not sure what you said that compelled me to write this, but... it needed to get out.