Q: I am thinking about retiring early. How can I cover healthcare costs if I retire before I am eligible for Medicare at age 65?

A: Congratulations! If you’re considering early retirement, hopefully this means that your years of saving and investing well have resulted in a nice nest egg that –  combined with Social Security and other income sources – will allow you to maintain your lifestyle without career work.

Given the cost of health care and the growing need for medical care as you age, it’s important to have some form of health insurance coverage. And, if you retire before age 65, you’ll want a plan to cover medical costs until Medicare kicks in.

Otherwise, you can explore coverage through the Consolidated Omnibus Budget Reconciliation Act (COBRA) or private health insurance to close the gap to Medicare eligibility age. COBRA only provides temporary benefits—up to a maximum of 18 or, in some cases, 36 months—but that may be enough for you. And private health insurance premiums can be expensive, depending on factors such as your age and health status. You may also be able to find and purchase an individual health insurance policy through either a state-based or federal health insurance Exchange Marketplace.

If you are being offered an early retirement package from your employer, check to make sure that it includes post-retirement medical coverage. Often, these packages provide medical coverage until you reach age 65 and become eligible to receive Medicare.

If your package does not include post-retirement coverage—or if you’re just plain retiring early—you will have several options for health insurance. One easy option: if you’re married and your spouse is still working, you may be able to secure coverage through his or her employer.

Once you have found coverage, remember that money that you have saved in an HSA can be used to pay insurance premiums and other qualified medical expenses tax-free. Tapping into those funds, if you have them, could close—or at least narrow—the gap if you need private insurance for a year or two.

Lastly, while working during your early retirement may not be part of your plan, taking a different or part-time job to keep health insurance might be an option.