Planning for retirement takes decades of hard work, and most workers are struggling to prepare for their golden years. Only 28% of baby boomers think they're doing a good job of saving for retirement, according to a report from the Insured Retirement Institute, and nearly a third say they expect to continue working past age 70.

One of the reasons saving for retirement is so challenging is that there are so many factors to consider. How much should you save by retirement age? At what age do you plan to retire? How will you cover healthcare expenses? How much will you be able to rely on Social Security benefits?

It can be overwhelming to think about all the factors involved in retirement planning. But there's one money move you may not even consider that could make or break your retirement.

Person handing over hundred-dollar bills.

Image source: Getty Images.

The key to long-term success: Accurately estimating your yearly retirement costs

The foundation of planning for retirement involves estimating how much you'll be spending each year once you leave your job. It's easy to simply wing it here, assuming you'll be spending around the same amount you are now. Many people also assume their costs will decrease in retirement, thinking they'll only need around 75% to 80% of their preretirement income to get by. For some people, that may be true. But it's not the case for everyone, and underestimating your retirement costs can be detrimental.

For instance, say you're currently spending $50,000 per year, and you assume you'll only need 75% of that in retirement -- or $37,500 per year. If you plan your retirement around only needing $37,500 per year but actually end up spending closer to $50,000 per year, you'll likely run out of money at some point in retirement.

You may not notice the effects of overspending right away if you have a robust retirement fund. After all, if you have hundreds of thousands of dollars in the bank, it may seem as if spending an extra few thousand dollars per year won't make a difference. But you will start to notice when your savings run dry in your final years of retirement -- which is likely when health issues will have started cropping up and you need the money the most.

Of course, you won't be able to predict exactly how much you'll spend each year in retirement. Even if you create a thorough, detailed plan, unexpected expenses will inevitably occur. However, planning as much as possible will help you avoid major financial setbacks in retirement.

How to create a detailed retirement budget

When planning your expenses in retirement, many of your future costs will be similar to your current ones. You'll still need to pay the rent or mortgage, for instance, buy groceries, and account for transportation. But there are some other significant costs you'll need to consider when budgeting for retirement.

Your healthcare expenses, for example, will likely change after you retire. Once you turn 65 years old, you'll be eligible to enroll in Medicare. That means if you retire before that age, you'll need to find insurance if you're not covered under your former employer. You could end up spending a lot more than when you were employed, which can quickly eat into your budget.

Also, health insurance isn't free even if you're covered by Medicare. You'll still have to pay all premiums, deductibles, copays, and coinsurance, and with Original Medicare (or Parts A and B), you may also be responsible for other out-of-pocket costs like prescription drugs and routine dental and vision care. Before you retire, make sure you know what you can generally expect to spend on healthcare, and factor those expenses into your retirement budget.

Taxes are another important cost to consider. If you're storing your cash in a 401(k) or traditional IRA, you'll owe income taxes on your retirement withdrawals. Depending on what tax bracket you fall into, you may owe thousands of dollars per year in taxes. And if you're not budgeting those costs into your retirement plan, you may end up spending more than you should each year.

You may owe taxes on your Social Security benefits as well, depending on how much you're earning. To figure out whether you'll pay taxes on your benefits, calculate your "combined income," which is half your annual benefit amount plus all other retirement income for the year. If your annual combined income is $25,000 or more (or $34,000 per year for married couples filing jointly), you might have to pay taxes on at least a portion of your Social Security benefits.

By considering all of these retirement costs as well as everyday living expenses, you can build a thorough retirement budget to estimate your future spending. The more accurate you are when estimating these costs, the more prepared you'll be for retirement -- and the fewer financial surprises you'll face down the road.