The Federal Reserve has swiftly tightened credit conditions over the last 15 months in an effort to bring down inflation. The federal funds rate -- which affects other interest rates throughout the economy -- has increased 5 percentage points since March 2022, the most aggressive series of rate hikes since the early 1980s.

Tighter credit conditions caused a significant deceleration in economic output last year, and some experts are forecasting a recession this year.

But there is a silver lining to the situation. Fed chair Jerome Powell recently said the rate hikes might be over, or at least winding down, and that portends better days for investors.

Since 1970, the S&P 500 has returned an average of 14.8% during the year following a rate-hike cycle. That means the index, which is currently down 12.6%, could hit a new high in the not-too-distant future.

Of course, new highs are on the horizon even if the Fed continues to raise rates. The S&P has never failed to recoup its losses in past bear markets, and there is no reason to expect a different outcome this time. One logical way for investors to capitalize on that information is to buy an S&P 500 index exchange-traded fund (ETF).

The S&P 500 can turn small sums of money into million-dollar fortunes

The Vanguard S&P 500 ETF (VOO -0.84%) is one of many good S&P 500 index funds, though its low expense ratio of 0.03% makes it a particularly compelling option. Like its benchmark, the Vanguard S&P 500 ETF measures the performance of 500 large-cap U.S. stocks.

Its constituents include value stocks and growth stocks from all 11 market sectors, meaning investors benefit from broad diversification across many of the most important domestic businesses. In a sense, buying shares of the Vanguard S&P 500 ETF is similar to buying a slice of the U.S. economy.

The S&P produced a total return of 577% over the last two decades, which is equivalent to an annualized return of 10%. At that pace, $115 invested weekly in the Vanguard S&P 500 ETF would be worth $98,000 in one decade, $349,000 in two decades, and $1 million in three decades.

Time in the market (not timing the market) matters

Some readers might be wondering if they should wait until the economy improves before investing in an S&P 500 index fund. The answer is no. The index typically hits bottom several months before economic activity does the same, meaning stocks tend to rebound well before a recession ends. Additionally, many of the S&P's best days occur during bear markets; missing even a few of those days can have catastrophic consequences for investors.

Consider the following: According to Hartford Funds, the S&P 500 returned 1,484% over the three decades that ended in 2022. That means $10,000 invested in an S&P 500 index fund in January 1993 would have grown into $158,434 by December 2022. But the calculus changes materially if the 10 best days are eliminated. In that scenario, the index would have returned 626%, meaning the initial investment would have grown into just $72,584.

There is one more piece to the puzzle. During the last three decades, more than half of the S&P 500's best days took place during a bear market. So, while it might seem prudent to sit on the sidelines during a drawdown, doing so is actually a recipe for underperformance. Time in the market, not timing the market, is the more important variable.

Here's the big picture: The S&P has returned 10% annually over the last two decades, and patient investors can expect similar returns in the future, provided they stay invested and keep buying consistently. But history says right now is an especially good time to buy. The S&P 500 tends to rise following the end of a rate-hike cycle, and many of the index's best days take place during a bear market.