The past year has been rocky for the stock market, and some experts are warning that there could be more volatility yet to come.

While we're not in a recession just yet, it could be looming. Despite the Federal Reserve raising interest rates multiple times, inflation has remained stubbornly high. As a result, the Fed could take a more aggressive approach with its rate hikes, which may spur a recession.

To be clear, nobody knows when or if a recession might occur. But that doesn't mean you can't prepare just in case, and there are two fantastic exchange-traded funds (ETFs) to buy right now if a recession is around the corner.

1. Vanguard S&P 500 ETF

The Vanguard S&P 500 ETF (VOO -0.84%) includes all the stocks within the S&P 500 index, which are from 500 of the largest and strongest U.S. companies. When you invest in this ETF, you'll own a small stake in all 500 of these businesses.

An S&P 500 ETF is one of the safest investments in general, but there are a few things that make it an especially smart choice during periods of volatility:

  • Instant diversification: A properly diversified portfolio is critical during a recession. If a few of your stocks don't survive a downturn (or if an entire sector is hit hard), a diversified portfolio can keep your money safer. Because this ETF includes stocks from 500 companies across a wide variety of industries, you have plenty of diversification within a single investment.
  • A selection of strong companies: The S&P 500 ETF not only offers exposure to a lot of different companies, but those companies are juggernauts in their respective industries. For example, some of the largest holdings in this fund include Amazon, Apple, Microsoft, Berkshire Hathaway, and NVIDIA. If there are any companies to survive a recession, it's those in the S&P 500.
  • A long (and successful) history: The S&P 500 itself has been around for many decades, and in that time it's survived countless recessions, crashes, and bear markets. No matter what happens this time around, the index -- and this ETF -- are extremely likely to pull through.

In other words, if you're looking for a low-maintenance, low-stress, risk-averse investment, this may be the ETF for you. By investing now and simply holding your investment for the long term, you're almost guaranteed to see positive returns over time.

Also, one other advantage of the Vanguard S&P 500 ETF, specifically, is its rock-bottom fees. This ETF has an expense ratio of just 0.03% -- one of the lowest in the industry -- which could save you thousands of dollars in fees over the long haul.

2. Vanguard Growth ETF

The Vanguard Growth ETF (VUG -2.25%) carries slightly more risk than the S&P 500 ETF, but it also has the potential for more lucrative earnings.

A growth ETF is a fund that includes stocks with higher potential for above-average returns. The S&P 500 has historically earned an average return of around 10% per year, for example, while the Vanguard Growth ETF has earned an average annual 13.16% return over the past 10 years.

There are several advantages and disadvantages to consider with this type of fund. The pros include:

  • Higher average returns: Again, growth ETFs are designed to beat the market, so you have a better chance of earning higher returns over time. While the difference between a 10% and, say, 13% average annual return may not seem like much, it can add up to hundreds of thousands of dollars over decades.
  • A healthy balance of risk and reward: The Vanguard Growth ETF, in particular, is a well-balanced fund. Roughly half of the stocks are from relatively safe companies that are leaders in their industries (such as Apple, Visa, and Home Depot). But there are also dozens of smaller stocks from up-and-coming companies with the potential for extreme growth. In other words, you essentially get the best of both worlds with this fund.

That said, there are also some downsides to consider, primarily the fact that around half of this fund is allocated to stocks in the tech sector. Tech stocks are famous for their volatility, which means that in the short term, you're likely to see more extreme ups and downs.

While those price swings can be tough to stomach, it also means that now is a more affordable time to buy. The tech industry has been hit hard over the past year, with many stocks watching their prices plummet. By investing during the low points, you could see substantial earnings when the market eventually recovers.

The future may be uncertain, and a long-term outlook is critical right now. By investing in the right places and holding those investments until the market rebounds, you can earn more than you might think.