Saving for retirement isn’t easy. In fact, studies show that Americans are, on average, way behind on their retirement savings. Even during the boom economy of recent years, experts say, two-thirds of Americans were behind on their retirement savings. That’s a bad situation, especially as the population ages and more and more Americans reach retirement age.

Hopefully, you’ve been doing everything you can. Ideally, you’ll have been saving money by spending less than you earn, using a household budget to ensure that things don’t get out of control. Hopefully, you’ve harnessed the power of the stock market to generate interest and passive income using your hard-earned money, and thereby avoiding losing too much of your cash’s value to inflation. Hopefully, you’ve created a nice emergency fund for sudden expenses, and have stashed it in liquid assets like cash in a place that’s easy to get to in a pinch, such as a checking account.

But let’s face it — even if you have been doing all of these things perfectly, there’s no guarantee that you’ll get through retirement without a major financial catastrophe. It’s all too easy for seniors to encounter sudden expense for reasons like health problems. With medical bills being such a huge part of American debt and bankruptcy, it’s easy to see why so many retirees run into financial trouble, even if they’ve done the right things with  money all their lives.

But you will have options in situations like this. Let’s talk about overcoming dangerous financial situations.

Make sure that you’re covered

One of the biggest threats to your retirement finances is your own health — or, perhaps more accurately, the medical bills that your health can make mandatory. Unfortunately, health care is not cheap in our country.

But you know that, as a senior, you have access to a powerful tool for keeping medical costs down: Medicare. You can get your Medicare policy once you turn 65. You can sign up during the annual enrollment for Medicare, or you could take advantage of a special enrollment period based on changing circumstances like a divorce, the death of a spouse, a move, a change in employment status, and other qualifying changes and events.

But don’t let the gaps that Medicare has cost you dearly. Make sure that you have supplemental coverage for things that could result in steep medical bills. For instance, Medicare doesn’t cover care that you get abroad — so get a gap plan or a travel insurance plan before you go on vacation, so that a slip-and-fall in Europe doesn’t empty your stateside bank accounts.

Getting cash when you need it

Even if you’re careful, you might encounter a sudden expense that you just can’t handle with the cash that you have on hand. Fortunately, you may be able to get cash from the assets that your hard work has earned you.

For instance, you may have been paying into a life insurance policy for years and years now (hopefully you have). Your beneficiaries are destined to get a life insurance settlement when you die. But it’s possible that, by the time that happens, you may have put your family deep in debt. You may be able to avoid that with something called a viatical settlement. In fact, viatical settlements allow you to sell your future insurance settlement for cash now. Selling your life insurance policy can allow you to avoid debt and leave your loved ones in a more financially secure position when you pass away — and, in the meantime, you’ll be better able to afford the care that you need to stick around a while longer.

You may also be able to draw cash from your other assets, including your home. Taking out a loan against your home can be a good way to turn that illiquid investment into cash; a reverse mortgage, for instance, will give you a monthly income against the value of your home (your lender will be repaid by your estate when you pass away, usually through the sale of your home).

Retirement isn’t always easy, but it should be a wonderful time. Make the right financial decisions, protect yourself, and make the most of your golden years.