Inflation has been in the news a lot over the past few years because it started soaring in 2021 and has been fairly rampant ever since. Granted, inflation has more recently started to cool nicely, and consumers may be in for some relief in 2024.

But one thing to be aware of is that inflation isn't a temporary trend. Rather, it's a persistent economic factor that has the potential to impact retirees in a negative way.

Over time, the value of a dollar is likely to erode. And so saving $100 for retirement today doesn't guarantee $100 worth of buying power in 20, 30, or 40 years down the line.

A person at a laptop.

Image source: Getty Images.

It's no wonder, then, that so many people worry about inflation. And that extends to older Americans on the cusp of retirement.

In a recent Nationwide survey of U.S. adults aged 60 to 65, respondents cited inflation as their No. 1 concern in the context of retirement finances. And if you're worried about rising living costs, there's one important step you should take in the course of your retirement planning.

Invest aggressively while you can

Retirees routinely rely on Social Security benefits to pay their expenses once they stop working. And the good news is that Social Security benefits are eligible for an annual cost-of-living adjustment (COLA), the purpose of which is to help seniors keep up with inflation.

The problem, though, is that those Social Security COLAs tend to fall short for beneficiaries -- even when they're fairly generous. In late 2022, the Social Security Administration announced that beneficiaries would be in line for an 8.7% COLA in 2023. But in a Motley Fool survey that followed, more than half of respondents said a raise that size wasn't enough to allow them to cover their bills.

If you're worried about the impact inflation might have on your retirement, one thing you should focus on now is investing your savings aggressively. Putting your 401(k) or IRA into stocks does indeed carry some risk. But the return you get on your money might more than make up for it.

A conservative retirement portfolio might generate an average annual return of 5% over a 40-year savings window. A $200 monthly investment during that time would result in a nest egg worth about $290,000.

That's not a negligible amount of money by any means. But a stock-heavy portfolio might deliver an average annual return of 8% instead of 5%. A $200 monthly investment over 40 years could, in that scenario, result in a nest egg worth about $622,000. That's more than double the total above.

Push yourself to take some risk

It's easy to see why inflation is such a major concern among near-retirees. But even if you're nowhere close to retirement age, you may still be worried about the impact of rising living costs.

The good news is that there's a key step you can take to maintain your buying power as a retiree even in the face of inflation. You do need to be willing to take on some risk in your portfolio. But if you play it too safe, you'll run another risk -- retiring with insufficient assets and struggling financially as a result.