Lifestyle is the factor that you can manage to some extent. The effect of genes can sometimes be influenced by lifestyle too. Then there is raw luck.
I'm at least as healthy in my 40s as I was in my 20s. My knees give me less bother anyway. My only hospital stays were birth related, so I'm blaming the DCs for being awkward buggers, they're still sods to get out 😉
The last prescription I had was covered by a maternity exemption... and that "baby" is at secondary school.
I've got a decent gene pool for longevity, but arthritis is a common family problem. By exercising and eating to support good bone density and muscle mass, maybe I can delay the inevitable... Another family issue is digestive systems, but fortunately in my 30s, I worked out what my IBS triggers are. Maybe I can delay or avoid aggravating conditions later in life...
But we're all mortal. There could be curveballs. At least by being active, eating well and having a generally decent lifestyle, I'm enjoying a good quality of life now. I can do things like charge around with my DCs and youth groups. Bonus, I'm potentially improving my odds on a longer state of healthy living or good recovery in the face of health issues, and reducing the odds of lifestyle triggered issues that don't have to be inevitable.
My granddad did not expect to have a long life. He lived to 84. Not bad for a portly gentleman with a love of fried food and beer, but actually until his devestating stroke, he walked every day on errands like buying his newspaper and going to the bookies, and while his diet wasn't anything people would blog about now, it was actually simple and surprisingly unprocessed. He backed up the recent school of thought that lard is better than the heavily processed seed oils and fats. He'd grown up in the slums- not all his siblings survived childhood. He was orphaned as a teenager and had to make his own way in heavy industrial jobs. It wasn't an easy life, but he got to enjoy nearly 20 years of a modest retirement in good health until his final week. It was a good way to go from his point of view.
The younger you can improve your lifestyle the better. Mine was never bad, but it did get a levelling up in my 30s after having DCs which serves me well now. I have a friend in her 70s who jogs parkrun in 37 minutes who started running in her 60s- her goal in the face of aging is to keep to a 60% age grading. She's a great role model!