Over the past 18 months, investors have seen one of the greatest bull markets in stock market history. After a remarkable recovery from the crash in March 2020, the S&P 500 has surged by a whopping 95% to date.

The unfortunate truth, however, is that bull markets can't last forever. Stock prices have to fall eventually, but nobody -- even the experts -- can predict exactly when that will happen. Some data suggests that a crash could be on the horizon, but if the market is famous for anything, it's unpredictability.

While you may not be able to predict when a crash will happen, you can prepare for it. Market downturns can be daunting, but as long as you're taking these two steps, you can rest assured that your portfolio will be able to survive even the worst market volatility.

Two people sitting at a table looking at documents

Image source: Getty Images.

1. Check your asset allocation

Asset allocation refers to how your portfolio is divided between stocks, bonds, and other assets.

Stocks are generally riskier than bonds, but they also tend to see much higher returns. If you want your investments to grow as much as possible, it's wise to invest relatively heavily in stocks. That said, allocating a portion of your portfolio to bonds can help reduce your risk, especially when the market is volatile.

Asset allocation is especially important as you age. When you're young, you can afford to invest more heavily in stocks. If a market crash occurs, you still have decades to let your investments recover. If you're nearing retirement age, though, a market crash could be financially devastating.

As you get older, it's wise to adjust your portfolio so that you're investing more heavily in bonds. A general guideline is to subtract your age from 110, and the result is the percentage of your portfolio that should be invested in stocks. If you're 40 years old, then, you should aim to invest roughly 70% of your portfolio in stocks and 30% in bonds.

Keep in mind that this calculation is only an estimate, and your asset allocation will depend largely on your tolerance for risk. If you're extremely risk averse, for instance, you may want to invest more in bonds than other investors your age.

2. Make sure you're buying the right investments

One of the most important factors when it comes to protecting your portfolio is the individual investments you own. The market will always be subject to volatility, and your investments will likely take a hit during downturns. But if you're buying the right stocks, there's a very good chance your portfolio will recover from even the most severe crashes.

Investing in the stock market is playing the long game, so it's important to choose stocks that are more likely to grow consistently over years or decades. These companies may not be the flashiest brands, but they're more reliable and have a better chance of bouncing back after a market downturn.

Choosing the right investments requires research. Be sure to look at factors like the company's financial performance over time, its leadership team, and how it stacks up against its competitors. By investing in the strongest companies, your portfolio will be unstoppable.

Market downturns are normal and happen regularly, but that doesn't make them less intimidating. By being strategic about your asset allocation and the investments you own, however, you can rest easy knowing you're ready for whatever the future has in store.