Most people are expected to outlive their retirement savings, a new study from the World Economic Forum found.

That should come as no surprise, as the median amount baby boomers have saved for retirement is just $152,000, according to a report from the Transamerica Center for Retirement Studies. That may sound like a lot of money, but if you withdraw, say, $30,000 per year, those savings will only last around five years.

So what's the secret to not running out of money in retirement? It can be tough to calculate how much you'll need, especially when nobody can predict exactly how many years they'll spend in retirement. But there are a few things you can do right now to ensure you have the best chance of making your money last the rest of your life.

Large pile of hundred dollar bills

Image source: Getty Images

1. Calculate your retirement number

In order to ensure your savings last through retirement, you'll need to know how much retirement will cost. In other words, you'll need to calculate your retirement number.

While it's tempting to simply aim for a big goal, like $1 million or $500,000, your retirement number is highly specific to your unique situation. The first step is to make an educated estimate about how much you expect to spend each year in retirement. Most people see their expenses decrease in retirement, but it depends on the lifestyle you expect to live. If you want to travel the world or buy a vacation home in Florida, you'll need more money than if you expect to spend most of your time at home relaxing and hanging out with the grandkids.

Use a retirement calculator to get an estimate of what you'll need to save by retirement age, as well as what you should be saving each month to reach that goal. Keep in mind that all retirement calculators are slightly different and will likely provide different results. To account for these differences, look closely at the inputs each calculator uses. Some will factor in Social Security benefits and inflation, for example, which will give you a more accurate estimate.

Once you know what you should be saving each month, create a plan to ensure you stick to your goals. Saving for retirement isn't something that can be done overnight, and it will take decades of consistent saving to amass hundreds of thousands of dollars (or more).

Build retirement saving into your budget just as if it were another bill to pay. If you think of saving for retirement as something you'll do if you have leftover money at the end of the month, you're more likely to put it off. And if you get into a habit of not saving each month, you're likely to fall short of your goal.

2. Consider how Social Security benefits will factor into your retirement

Social Security benefits can help cover some costs in retirement, but they shouldn't make up the majority of your income. The average Social Security check comes out to around $1,400 per month, which isn't enough for most people to live comfortably on.

That said, knowing how much you'll be receiving in Social Security will impact how much you'll need to save on your own. You can check your statements online to get an estimate of what you're expected to receive in benefits once you claim, which will help you get a sense of how much you can rely on them to cover your retirement expenses.

It's important to remember, however, that your benefits aren't set in stone. There's a possibility that benefits will be cut in the next few decades, so if you're depending on Social Security to make ends meet in retirement, you may want to have a backup plan in place.

Also, the age at which you claim your benefits will affect how much you receive each month. While you can claim them as early as age 62, doing so will result in a reduction in benefits of up to 30%. The only way to receive the full benefit amount you're theoretically entitled to is to claim at your full retirement age (FRA). Claim before then, and your benefits will be reduced. But wait until after your FRA to claim (up until age 70), and you'll receive a boost in benefits of up to 32% on top of your full amount.

In theory, your benefits should be roughly equal over a lifetime no matter when you claim. You'll either receive more checks that are all smaller, or you'll get fewer (but bigger) checks. The math doesn't always work out perfectly, though, so you could come out ahead by claiming earlier or later. If you expect to live a long retirement or if your savings are falling short, it may be smart to delay claiming to receive those bigger checks. But if you have reason to believe you won't spend decades in retirement, filing early to enjoy your benefits while you can may be the best choice.

3. Think about how you'll cover healthcare costs

Healthcare costs are one of the biggest (yet most unpredictable) expenses you'll face in retirement. That can make them difficult to plan for, as you may spend little more than your standard premiums, or you could spend thousands of dollars per year on out-of-pocket expenses.

Even though you can't predict exactly how much you'll spend on healthcare, you can prepare the best you can for these costs. If you currently have health conditions that will be expensive in retirement, start planning for those costs now. And if you have any history of certain conditions in your family, it may be a good idea to plan for those too just in case.

Regardless of your health history, there are certain costs you will be responsible for. Once you turn 65, you'll be eligible for Medicare. With Medicare coverage, you'll still be responsible for all premiums, deductibles, and coinsurance, as well as any other out-of-pocket expenses Medicare won't cover. Original Medicare (or Parts A and B) doesn't cover most routine care, such as dental and vision care, nor does it cover prescription drugs -- you'll need Part D coverage for that. You can opt for a Medicare Advantage plan that offers greater coverage, though these plans are often more expensive than Original Medicare.

Long-term care is another expense Medicare won't cover. This cost can be significant, too, with the average semi-private home in a nursing home costing around $6,800 per month, according to the U.S. Department of Health and Human Services. Long-term care insurance can help cover some of these costs, but the key is to enroll early -- if you wait until you're in your 60s or later, insurance providers will either charge you sky-high rates or refuse coverage altogether.

Planning for retirement is ultimately a guessing game, as there's no way to predict exactly how much you'll need to last the rest of your life. But by preparing yourself the best you can right now, you're giving yourself a good chance of living your ideal retirement life.