The pandemic has put a dent in many people’s financial lives, affecting their ability to save and stash away cash for retirement. Add the fact that more Americans are living longer, and the prospect of financial security in retirement for many is falling short.

But if you’re concerned about running out of money in retirement, you’re not alone.

“A successful retirement is all about having a spending plan and making sure that spending plan incorporates inflation and healthcare costs,” said Patricia Wenzel, senior financial advisor at Merrill Lynch and president of the National Association of Plan Advisors.

Here are six steps you can take to avoid running out of money in retirement.

1. Start planning now

It’s never too late to start planning. Although it might be impossible to know how long you’ll live or what your health may look like in the future, there are things you can plan for now that can set you up well for retirement.

“Unfortunately, many people wait until they are almost ready to retire to start planning for retirement,” Wenzel said. “Decades before you retire, you should start evaluating your numbers.”

Figure out what age you plan to retire, how much you are saving, what your estimated expenses are, how much income you will need to live on and how much you already have saved for retirement.

Wenzel also suggests evaluating your estimated Social Security payments to get a better sense of how much it will contribute toward your retirement income goals.

Keep in mind those estimates will vary based on when you start collecting Social Security payments.

“If you plan on retiring in your mid- to late-60’s, you really have to plan on living well into your 80’s and 90’s – especially for women,” Wenzel said.

2. Save as much as you can

The sooner you start saving, the more time your money has to grow.

In your younger years, even a small amount of savings can go a long way. The longer you wait, the more you’ll need to set aside to meet your goals. So it’s always a good idea to try and put away as much as you can.

Most experts suggest saving anywhere between 10% to 15% of your gross salary, which also includes any contributions you may receive from your employer.

But the bottom line is to save whatever you can, even if it’s not a full 10% of your income.

“No matter your income or savings levels, having a realistic financial plan can help maintain your financial security through all stages of retirement,” said Keith Bernhardt, vice president of Retirement Income at Fidelity Investments.

3. Invest the money you save

But it doesn’t stop there. Don’t forget to invest the money you save. Compound interest can work wonders for your money. Just as with saving, the earlier you start investing, the more your money can grow.

Make sure you are putting your savings into a tax-advantaged retirement account, such as an employer-sponsored 401(k) plan or an individual retirement account, or IRA. Some company 401(k) plans offer matching contributions, in which case you want to make sure you’re contributing enough to receive the full employer match.

But 401(k)s and IRAs aren’t the only ways to save for retirement. Health savings accounts, or HSAs, and other tax-advantaged accounts can also help you reach your retirement fund goals.

“You want to have money in different places to make sure that you don’t run out of money in the end,” said Bryan Stiger, a financial planner at Betterment 401(k).

Another place to invest some of your money that can guarantee it won’t run out is an annuity. Annuities are a type of investment typically issued by an insurance company and can provide a steady stream of regular payments that are unaffected by financial markets and can last a lifetime. There are different types of annuities you can buy to fit certain needs. But some of them come with hidden costs, such as high commissions, annual fees or surrender charges on early withdrawals.

Traditional annuities, also known as fixed rate annuities, provide a guaranteed interest rate on your money for a set period of time – often for the rest of your life. Fixed-rate annuities typically have no annual fees and lower commissions than other types, but there are penalties for early withdrawals before retirement of 10%.

4. Create good habits

Curbing your spending can also help boost your savings. Take the time to set up a budget and stick to it. You’ll also want to make sure you have an emergency fund set up for unforeseen circumstances, such as a medical emergency or job loss. Most experts suggest saving at least three to six months worth of living expenses.

Wenzel noted that your spending in retirement won’t change much compared to your spending during your pre-retirement years – so mastering good financial habits, like budgeting, investing and shoring away emergency funds, can go a long way once you do finally retire.

5. Eliminate debt before you retire

Carrying substantial amounts of debt in retirement can eat away at your hard-earned cash. Not to mention, many types of debt, such as credit cards and student loans, can come with high interest rates.

Try to reduce or eliminate debt before you retire. That can free up more cash to put toward savings. Once you’ve paid off a loan, you can redirect those payments toward your retirement account.

A financial adviser can help you with both retirement planning and debt repayment strategies to ensure you retire debt-free. Or perhaps you can plan to work longer or downsize on big item purchases, like a house or car, to free up money and tackle your debt.

6. Don’t withdraw too much or too early

Withdrawing too early from your retirement savings can have damaging consequences. You may be subject to early withdrawal penalties or you may even lose tax benefits.

The current IRS penalty for withdrawing funds early from a 401(k) is 10% plus your income tax rate on the amount you withdrew. Remember, the money in your retirement account is for your retirement. So avoid the temptation to pull from those funds before your expected retirement age.

The same goes for withdrawing too much once you retire. A general rule of thumb is to follow the 4% rule, which means that you withdraw 4% of your retirement savings each year (adjusted for inflation). The idea is that you can usually expect at least a 4% return on your investments so you won’t run out of money over the course of a 30-year retirement.

However, that number isn’t set in stone. If you have a larger nest egg, some experts might suggest a bit higher withdrawal rate of between 4.5% or 5% – but no more than 5%. While others, suggest taking a more conservative approach – a withdrawal rate of anywhere between 3% or 3.5%.

“It depends on the individual,” said Stiger. “Having low expenses are the biggest driver of a successful retirement or accumulating money.”