Q: I'm worried that the market is due for a crash. How can I prepare for it?

There's no way to accurately time a market crash, so it's generally a bad idea to sell your investments in anticipation. Many experts were predicting one in 2015, but the bull market has continued, and the S&P 500 is up 18% since then. People who sold in anticipation of a market crash would have missed out on this additional upside.

The same logic applies now. The market will eventually crash, but it's entirely possible that we could have a few more years of strong returns first.

That said, it could be a good idea to allocate more of your portfolio to stocks that tend to hold up well during bear markets. Dividend stocks with excellent track records of increasing their payouts are a good example. For instance, shares of companies like Wal-Mart Stores and Procter & Gamble both handily beat the S&P 500's return during the 2008 crash. In fact, Wal-Mart gained nearly 20% in 2008, while the S&P 500 lost 38%.

Also, while I don't advise getting out of stocks in anticipation of a crash, now could be a good time to start raising cash. For example, if you contribute $400 per month to your IRA, you may want to leave your next few contributions un-invested for the time being. This will allow you to take advantage of bargains that could come with a market crash.

As Warren Buffett has said, "When it rains gold, put out the bucket, not the thimble." In other words, a crash produces some excellent opportunities for long-term investors, so put yourself in a position to buy rock-solid stocks at bargain prices whenever the next one comes.

Matthew Frankel has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.