The stock market has been shaky over the last several weeks, with the S&P 500 down close to 9% since the beginning of the year.

Some investors may worry that we're headed toward a full-blown market crash, but nobody knows for certain what the future holds. The market could crash or may bounce back from this downturn and continue surging.

That said, periods of volatility can be unnerving. It may be tempting, then, to pull your money out of the market, just in case prices continue to fall. But is that the right move for you?

Person looking at a laptop and feeling worried.

Image source: Getty Images.

Should you withdraw your money?

It's impossible to predict exactly how the market will perform over the coming weeks or months. Even the experts can't say for certain what will happen, which can make it challenging to prepare for a potential crash. While pulling your money out of the market may seem like a wise choice, it can be riskier than you might think.

In an ideal world, you would withdraw your investments just before a crash, then reinvest once prices are at their lowest to take advantage of the rebound. In the real world, though, that strategy is extremely difficult to pull off successfully.

Because the market is unpredictable, it's nearly impossible to time the market effectively. If you pull your money out now and prices surge, you'll miss out on those gains. If you reinvest later, you could end up paying even more if prices have continued to increase. On the other hand, if you wait too long to sell, you could lose money if prices have dropped substantially.

What should you do with your investments?

Although it may sound counterintuitive, one of the best ways to protect your investments against market downturns is to do nothing.

When you hold your investments, you won't lose any money if the market takes a turn for the worse. Your portfolio may drop in value in the short term, but as long as you don't sell, you won't lock in those losses. When the market inevitably recovers, your investments should rebound, as well.

Choosing the right investments is key, then, to surviving downturns. Strong companies are more likely to bounce back after periods of volatility. By filling your portfolio with these types of stocks, your investments have a better chance of pulling through, as well.

Right now is the perfect opportunity to comb through your portfolio and double-check that all of your stocks are strong long-term investments. They should have solid underlying business fundamentals, healthy financials, and a competent leadership team.

Stock market downturns can be intimidating, but with the right strategy, there's a good chance your portfolio will survive. By choosing the right investments and maintaining a long-term outlook, you'll be prepared for whatever the future has in store for the market.