So you know how important it is to save for retirement, and you feel you're doing everything you're supposed to. You're contributing regularly to your 401(k), diversifying your portfolio, and saving as much as you can.

But that may not be enough to retire comfortably.

About 55% of retirees are at risk of running out of money during retirement, according to a Fidelity study, and while it's easy to simply assume that these people planned poorly, the truth is that it's easier than you may think to hurt your chances of a comfortable retirement. And all it takes is a few mistakes to sabotage your retirement fund. Here are the three big ones.

Woman slapping herself on the forehead in frustration

Image source: Getty Images.

1. Failing to consider healthcare costs

The best way to start planning for retirement is to create a retirement budget by mapping out all of your expected expenses to get a rough estimate of how much you'll need each month. But many people forget about healthcare costs.

This is partly because of the misconception that Medicare will cover all your healthcare expenses once you turn 65. While Medicare will cover some of your costs, it doesn't cover everything. Dental care, hearing aids, eye care, and long-term care are not covered, and you're also still responsible for copayments, coinsurance, and deductibles. And all of these costs add up quickly.

According to an AARP study, half of all Medicare beneficiaries pay over $3,000 per year out of pocket to cover medical expenses. And long-term care can put a serious dent in your savings, given that a private room in a nursing home costs an average of $78,000 per year, while in-home aid can cost nearly as much.

In other words, it doesn't take much for healthcare costs to wipe out a retirement fund that wasn't built to cover them. And while you can't predict exactly how much you'll pay for healthcare as a retiree, opening an HSA or building a buffer into your retirement fund will help you handle both expected and unexpected costs.

2. Underestimating how long retirement will last

Men and women turning 65 years old this year can expect to live until age 84 and 86, respectively. But one in four 65-year-olds will live past age 90, and one in 10 will make it past 95. And with healthcare continuing to advance, those who are younger than 65 now may have even longer life expectancies by the time they retire.

While this is great news for Americans, it's not such great news for their retirement funds. If you only plan for a 20-year retirement and you end up living 30 years past your retirement date, then your savings could be hundreds of thousands of dollars short. And when you consider that you'll experience more health problems as you age, your expenses may only increase throughout retirement.

The best way to address this is to assume you'll live to at least age 95 and plan accordingly. If you simply can't spare another dollar for retirement savings, then you should at least study up on how to maximize your Social Security benefits. Say you're turning 62 this year, so you can technically start receiving Social Security benefits now. Your full retirement age in this scenario would be 66 and 2 months, and we'll assume you're eligible for the average monthly retirement benefit of about $1,300. If you take benefits at age 62, you'll only receive about $960 per month -- 25% less than you'd receive if you waited until your full retirement age. But if you wait until age 70, you'll rack up delayed-retirement credits and boost your eventual benefit to nearly $1,700 per month.

Sure, it's not fun to work another eight years, but an extra $700 per month amounts to about $8,400 per year, which can go a long way toward covering the bear necessities. Not to mention the fact that during those extra eight working years, you'll (hopefully) continue contributing to your 401(k) or IRA and bulking up your nest egg.

3. Making unnecessary withdrawals

When you're young, retirement is probably the last thing on your mind. So when you have thousands of dollars sitting untouched in your retirement fund, it's tempting to withdraw some of that money for a big purchase.

The government also makes it relatively easy to withdraw money from your retirement fund. For example, while you will face a penalty for withdrawing from an IRA before age 59 1/2, that penalty may be waived if your withdrawal goes toward a first-time home purchase, educational expenses, or medical expenses. So if, for instance, you really want to buy that new home but need an extra $5,000 for the down payment, it's easy just to pull it from your retirement fund, thinking that $5,000 won't be a big deal in the long run.

The problem is that even tiny investments add up over time, so withdrawing small amounts can make a big difference. Because of the power of compound interest, you'll get the most out of your money by investing it early and then leaving it alone.

So let's say you did withdraw $5,000 from your IRA to pay for a down payment on a home. If you had, say, $50,000 in your account to begin with, here's what your balance would look like in 10, 20, and 30 years (assuming in both cases you're not making any additional contributions and that you're earning an annual return of 7%):

Years Balance if You Withdraw Money Balance if You Don't Withdraw Money
0 (today) $45,000 $50,000
10  $88,522 $98,358
20  $174,136 $193,484
30  $342,552 $380,613

So that $5,000 withdrawal could end up costing you nearly $40,000 in the long run unless you start saving a lot more to catch up.

Even if you think you're doing everything you can to save for retirement, chances are you could be doing more to plan ahead and have all your bases covered. Overlooking just one factor can be detrimental to your retirement, and a little extra preparation will go a long way.