When planning for retirement, you've probably given a lot of thought to how much money you'll need, how much you can withdraw each year, and when you're going to start claiming Social Security. But if you plan to retire before 65, you have another important question to ask yourself: What are you going to do about healthcare?

You don't become eligible for Medicare until you're 65, unless you've received Social Security disability benefits for at least 24 months or you have end-stage renal disease, in which case you'll receive free hospital coverage (Medicare Part A). But few people qualify for these special circumstances, so you'll probably need to make other arrangements.

Doctor talking to elderly man

Image source: Getty Images.

You have several options. The one thing you don't want to do is gamble that you won't have any medical expenses between now and 65 and skip health insurance coverage altogether. Even if you're in perfect health, you never know when an accident could send you to the emergency room. If you don't have health insurance, you'll pay for all of these expenses out of pocket, which could put a serious dent in your retirement savings, threatening your financial future. Try one of these alternatives instead.

Use your spouse's health insurance.

If your spouse continues to work when you retire and you can get health insurance through your spouse's job, consider switching over to this health insurance policy instead. This may be your most affordable option. Health policies offered through an employer usually cost less than individual policies because your employer usually pays part of your premiums.

Be sure to evaluate the policy's deductibles, co-pays, and coverage before making your decision. If you aren't satisfied with the coverage that it offers, you may want to consider one of the following alternatives instead.

Keep your former employer's health insurance.

The Consolidated Omnibus Budget Reconciliation Act (COBRA) states that when you leave your job, your employer must give you the option to keep your health coverage for up to 18 months. In certain situations, like a family member becoming disabled, you may be able to get this deadline extended.

The catch is, if you choose to accept the COBRA health insurance, you pay the entire premium, including the amount your employer had been paying on your behalf. The insurance company may even add on extra charges in administrative fees, so your once-affordable health insurance plan may no longer be affordable. Talk to your company's HR department or your health insurance provider for information about how much it would cost to stay on your employer's plan once you retire.

Buy an individual health insurance plan.

You can purchase a health insurance plan on your own if neither of the above options suits you. Search for an individual health insurance plan through the Health Insurance Marketplace. This is a government-run site that connects you with health insurance plans in your state. You can also get quotes from individual health insurers by visiting the company websites and inputting some basic personal information.

You have 60 days after leaving your job to purchase new health insurance. If you miss this special enrollment window, you'll have to wait for the open-enrollment period to change your health insurance. The next open enrollment period runs from Nov. 1, 2019, to Dec. 15, 2019. Plans sold during this time will take effect on Jan. 1, 2020.

When comparing individual health insurance plans, pay attention to the deductibles, co-pays, premiums, and coverage options. Look at several plans to find the one that best aligns with your health needs and budget. Make sure the plan you choose enables you to use your preferred doctor and that you're comfortable with its coverage for your recurring or planned medical expenses, like prescription drugs.

If you purchase a health insurance plan with a deductible of more than $1,350 for an individual or $2,700 for a family, you're eligible to open a health savings account (HSA). This enables you to set aside up to $3,500 for healthcare expenses in 2019 for individuals or $7,000 for families. If you're 55 or older, you can contribute an additional $1,000 over that limit.

Money you contribute to an HSA reduces your taxable income in the year you make it, and you won't pay any taxes on it at all if you use it for qualifying medical expenses. You can use the money for nonmedical expenses, but you'll pay income tax on it, plus a 20% penalty if you're under 65. After 65, the penalty goes away, though you'll still pay tax if you use the money for nonmedical expenses. Contributions never expire, rolling over from one year to the next, so you don't have to worry about using up all the funds before the end of the year.

It's best to come up with a plan for health insurance before you retire so you don't have any gaps in coverage. Explore your options today to see which offers you the best coverage for the most affordable price.