Nothing "guarantees" a long healthy life.
The best you can do is put your body in the best position to improve your chances of a long healthy life.
Lots of diseases/conditions have no known "causes", so literally anyone can get struck down with them, however healthy/well you've lived your life. BUT, being fit and healthy generally can certainly improve your chances of getting through it, i.e. greater tolerance to medication such as chemotherapy, greater chances of surviving infections etc you acquire whilst in hospital, etc. It's widely accepted that being fit and healthy can improve the effectiveness of some medications/drugs/treatments.
Obviously, if you do "risky" things like smoking, excessive drinking, unhealthy eating, lack of exercise, you increase the risk of not only getting conditions/diseases linked to those poor lifestyle choices, you also increase the risk of medications/treatments not being as effective or not being tolerated, and increase the risks of not surviving infections, etc.
No guarantees of anything. Lots of heavy smokers don't get lung cancer, lots of overweight people don't get diabetes, but likewise lots of fit/healthy people get various cancers that don't have known "causes" and couldn't reasonably have been avoided by doing things differently (well not according to current medical knowledge anyway).
I've known 3 people who've had breast cancer, all at relatively young ages (under 50). The one who survived the longest (over 30 years) was the one who'd led a fit and healthy life and continued to live healthily after treatments (it returned twice, first after 20 years and then after another 10 years). The other two weren't specifically unfit or unhealthy, but they weren't as healthy, and both struggled more through chemotherapy and despite the first course of treatment working and putting them in remission, cancer returned more quickly (around 5 and 10 years respectively), and the second round of treatment wasn't as effective and didn't really work, meaning sadly neither survived as long. Yes, anecdotal "evidence" but it seems to broadly fit in with the idea of being fit and healthy generally improves your chances of surviving major health traumas.
After all, life length and health is really just about probabilities - nothing is guaranteed, but you can improve your chance/probability of a longer/healthier life by looking after your body and not taking risks/abusing it etc.