Many people find that their expenses go down in retirement. And that makes sense. Mortgages are often paid off, cars are often loan-free, and commuting costs don't come into play.

But if there's one expense that tends to rise during retirement, it's healthcare. And that's in spite of the fact that retirees are commonly eligible for coverage under Medicare.

A person at a laptop.

Image source: Getty Images.

If you want to avoid a world of unpleasant surprises in retirement, then it's important to read up on how Medicare works. Here are a few things you should know that are apt to make your life easier down the line.

1. When to sign up

Your initial window to sign up for Medicare lasts for seven months. It begins three months before the month of your 65th birthday, and it ends three months after that month.

It's a good idea to enroll in Medicare during that initial window unless you're covered by a qualifying group health plan through a job. That generally means being on a plan with 20 employees or more.

If you don't sign up for Medicare on time, you'll risk lifelong surcharges on your Part B premiums. Just as problematic is the fact that you may end up without coverage for a period of time. If you were to get hurt or sick without health insurance, the financial results could be catastrophic.

2. What costs you might face

It's a big misconception that coverage under Medicare is free. Not only are there premiums for Part B, which covers outpatient care, and Part D, which covers prescriptions, but there are costs like copays, deductibles, and coinsurance enrollees need to cover.

This year, for example, the inpatient deductible for a hospital admission under Medicare Part A is $1,632. In other words, you'll pay that sum every time you have to stay in a hospital, and it only covers your first 60 days.

There's also an annual Part B deductible you'll have to pay before Medicare picks up the tab for your care. This year, it's $240.

It's important to know what costs you might be looking at as a Medicare enrollee so you're able to factor them into your budget. In addition, plan on signing up for Medigap coverage as soon as you're able to. A Medigap plan could help offset some of the costs you might otherwise face.

It could also be a good idea to fund a health savings account while you're working and reserve that money for your senior years. That way, you'll have funds to tap for expenses like copays you end up on the hook for.

3. How to pick a Part D plan

If you sign up for original Medicare, which is Parts A and B, you'll need to pick a Part D drug plan as well. To choose the right plan, you'll want to look at not just premiums, but also, formularies for medications. These will determine how much of a copay you might be looking at for the drugs you take.

The good news is that Medicare has a useful plan-finder tool that can help you narrow down your choices based on your specific medication needs. But take the time to compare plan options before making your decision. And also, plan on reviewing your Part D options each year during fall open enrollment in case your needs change or your plan changes.

The more you know about Medicare ahead of retirement, the more confident you can be as that milestone approaches. Read up on the program extensively to go in prepared.