Over the past couple of years, the stock market has been shattering records. The S&P 500 is up nearly 28% so far this year, and it's increased by more than 114% since the last market crash in March 2020.

All this growth can't last forever, though, and a market downturn could be looming. Some experts believe stock prices are overvalued and due for a correction, and concerns surrounding the COVID-19 omicron variant could lead to greater stock market volatility.

If a crash is on the horizon, it may be tempting to pull your money out of the market now to avoid any potential losses. But that could be a risky move for a few reasons.

Person feeling worried while looking at a laptop.

Image source: Getty Images.

Should you pull your money out of the market now?

In theory, it makes sense to withdraw your savings from the stock market before a crash. Then when stock prices drop, you can reinvest at a lower price and make a quick profit. However, this strategy is more difficult than it may seem.

The stock market is unpredictable, and it's impossible to know exactly when (or if) a downturn will occur. If your timing is off, you could potentially lose a lot of money.

Say, for instance, you decide to pull your money out of the market right now. If the market continues surging, you'll have missed out on those earnings. Then if you reinvest later, because prices have gone up, you'll end up paying more for the investments you just sold.

Also, the market fluctuates from day to day. When stock prices drop, it can be tough to tell whether we're on the verge of a crash or if the market will rebound quickly. If you wait until prices have fallen significantly to sell your stocks, you may be selling for a discount and locking in your losses.

Timing the market effectively is nearly impossible, so it's best to avoid selling your stocks during periods of volatility. Fortunately, there are other ways to protect your investments against market crashes.

Protecting your savings when the market is volatile

Market downturns may be intimidating, but they're normal -- and temporary. The stock market has a 100% success rate when it comes to recovering from corrections and crashes, so if a downturn does occur, it's almost guaranteed that the market will eventually bounce back.

To ensure your investments survive, then, one of the best things you can do is simply ride out the storm. While your portfolio may take a hit in the short term, the market will eventually recover. By holding your investments for the long run, it's more likely your portfolio will bounce back as well.

Keep in mind, too, that you don't lose money on your investments unless you sell. Even if stock prices hit rock bottom, you won't lose anything as long as you hold your stocks until the market recovers and prices rebound.

Finally, to give your portfolio the best chance of recovering from a market downturn, double-check that you're investing in strong stocks with long-term potential. Companies with solid underlying fundamentals make for the strongest investments, and they have the best chance of surviving market volatility.

It may be impossible to predict when or if a market downturn will happen, but that doesn't mean you can't prepare. By filling your portfolio with solid investments and holding those stocks for the long term regardless of what the market does, you'll be in fantastic shape to weather any potential stock market storms.