In May 2021, Warren Buffett offered advice to investors at Berkshire Hathaway's annual meeting. For context, the stock market was soaring at the time -- the S&P 500 had climbed 48% in the previous 12 months -- fueled by unbridled enthusiasm brought on by stimulus checks, low interest rates, and the reopening of businesses in the wake of the pandemic. But Buffett's words were sobering.

He told his audience that many new investors were essentially gambling. Buffett also expressed his belief that index funds were a better option than individual stocks for the average person. Specifically, he recommended holding an index fund comprised of a diversified group of U.S. equities over a long time horizon.

Of course, the macroeconomic environment looks much different today. Rampant inflation and rising interest rates have caused the S&P 500 to crater, sending the benchmark index into bear market territory. But inflation hit a fresh 40-year high in May, so things may get worse before they get better. The S&P 500 is currently 23% off its high, but there have been six bear markets in the last 50 years, and the index dropped by over 45% on three of those occasions.

Building on Buffett's advice, here is one investment strategy that could help your portfolio weather the current downturn.

A diversified index of dividend stocks

Many dividend stocks outperform the market during downturns, especially those that regularly raise their payouts. The reason for that is simple. Only high-quality businesses generate enough cash to consistently pay shareholders a dividend that increases over time. If you reconcile that idea with Buffett's advice, the Vanguard High Dividend Yield ETF (VYM 0.24%) looks like an attractive investment idea right now.

The Vanguard High Dividend Yield ETF comprises 443 U.S. stocks that span 10 market sectors, though 55% of the fund is allocated to consumer staples, energy, utilities, industrials, and healthcare, all of which tend to outperform in inflationary environments. Another 20% of the fund is invested in the financial sector, which tends to outperform in rising interest rate environments. To that end, the Vanguard High Dividend Yield ETF is currently just 14% off its high, easily outpacing the 23% decline in the broader S&P 500.

Also noteworthy, four of the index fund's top 10 positions are stocks Buffett owns through Berkshire Hathaway. That includes Chevron and Bank of America, which account for 19% of Berkshire's investment portfolio. Better yet, the Vanguard High Dividend Yield ETF bears an expense ratio of just 0.06%, meaning you would pay just $6 on a $10,000 portfolio, and its dividend yield currently sits at 2.72%, meaning a $10,000 portfolio would generate $272 in passive income each year.

As a caveat, while the Vanguard High Dividend Yield ETF has significantly outperformed the broader S&P 500 over the past year, especially when accounting for dividend payments, the S&P 500 typically wins in the long run. For instance, the S&P 500 has generated a total return of 65% over the past five years, while the Vanguard High Dividend Yield ETF has generated a total return of 47%.

However, you can't put a price on peace of mind. If your current portfolio composition has you worried about the impact of runaway inflation, consider starting a position in this index fund. I think Warren Buffett would like the idea.