The last few weeks have served as a stark reminder that stocks can be volatile — sometimes extremely so.

The S&P 500 fell by more than 5% in January, its worst performance since the pandemic began, and markets remained choppy through the first two weeks of February. Experts expect the volatility to continue going forward, amid concerns about inflation and rising interest rates, geopolitical uncertainty, and the ongoing pandemic.

“There are a lot of headwinds,” said Craig Ferrantino, founder of Craig James Financial Services in Melville, New York. “Some of it is temporary, but some of it might take a long while to clear out. There is a lot of economic uncertainty.”

Market volatility can be a good thing for long-term investors who dollar-cost average – meaning they contribute regularly to their investment accounts over time – since it allows them to hedge their risk by buying stocks at both the highs and lows, smoothing out the returns.

But recent market performance has some investors anxious about a potential correction, during which the market falls by 10% or more from recent highs.

“For the average retirement investor who doesn’t have an adviser reminding them during the upcycles that there is going to be a correction, it can be a scary time,” said Deborah Meyer, a certified financial planner and CEO of WorthyNest. “That’s especially true for you millennials who haven’t been through a market crash before.”

If you’re worried about your investments, take a deep breath and then follow these steps:

1. Take money you need in the short-term out of the market

Experts advise against keeping any money you will need in the next five years (or sooner) out of the stock market entirely and moving it into safer investments like a high-yield savings account or a money-market fund. That includes your emergency fund, as well as cash you’ve set aside for near-term goals like a down payment on a home, or renovation or wedding.

If you’re retired or nearing retirement and you plan to draw on your portfolio for everyday costs, consider moving up to two years’ worth of expenses out of the stock market.

“So long as you know your liquidity needs are met, you can let your portfolio do its thing, and you will weather through any potential recession,” said Nancy Hetrick, founder and CEO of Smarter Financial Solutions.

2. Stick to your plan for longer-term investments

For longer-term investments, remind yourself what you’re saving for. If you’re putting money aside for a retirement that’s decades away, for example, or college tuition for your toddler, you have plenty of time for your investments to recover from any dips or even a correction.

The reason most advisers recommend that long-term investors keep the bulk of their money in a diversified portfolio with a heavy allocation to stocks is that volatility and short-term risk allows for higher returns over time. But you should determine what allocation is best for you based on your time horizon and personal risk tolerance.

“Even the biggest firms can’t time the market in the short term,” said Anthony Mezzasalma, a certified financial planner with Mezzasalma Advisors. “The way to get around that is to have a plan and make sure that the money we’re taking risks with is invested for the long-term.”

Having a pre-determined asset allocation (and determining which circumstances would justify you making changes to it) allows you to avoid making emotional decisions about your investments when volatility hits. The longer you can remain invested in the market, the more time you’ll have for your investment gains to compound, negating the impact of day-to-day market movements.

3. Make sure you have realistic expectations

Even with the short bear market that hit at the start of the pandemic, investors have enjoyed record performance in recent years. The S&P 500 is up nearly 60% over the past three years.

It’s easy to forget that historically speaking, annual returns hover closer to 10%, and that bear markets (pullbacks of 20% or more) hit, on average, once every two to three years. That means that expecting your investments to continue to perform as they have over the past three years is not realistic.

“Even if you know that volatility is normal, it can be a very visceral experience when we see our wealth vanish,” said Donald Calcagni, chief investment officer with Mercer Advisors. “But it comes back to having a plan, and sticking to it.”