Save up a big fat pile of money before you retire.
Sure, once you hit 65 you will be eligible for Medicare. That will take care of a lot of your medical expenses, but probably not all. You will be required to pay a premium for some of your Medicare coverage, and you will probably want to purchase a private Medigap policy to cover all the costs that Medicare doesn't. Fidelity Investments estimates that a 65-year-old couple who retired in 2015 would need $245,000 of their own savings to handle 20 years of out-of-pocket retirement health costs.
And be careful about relying on your employer's promise to provide health care benefits once you retire. Even those that pledge such care may find it hard to live up to their promise when you hit retirement. More and more big companies in a financial pinch are reducing or rescinding health insurance benefits once promised to their retirees.