It has been a brutal year for the stock market, but downturns like the current one are often the best time to invest. In theory, because valuations are depressed, investors have the opportunity to buy shares of quality companies at a bargain and watch their positions grow.

Of course, the hard part is finding the right stocks. But a simple way to dip your toe into a volatile market in a still uncertain economy is to invest in exchange-traded funds (ETFs). ETFs allow you to invest in a broad portfolio of stocks based on an index as opposed to building your own portfolio of individual companies. It's a relatively easy way to invest without taking on excess risk, particularly for those who aren't sure where to begin.

Here's how one investment of $10,000 in a diversified ETF could grow to well over $300,000 given enough time.

A look back to 2002

We can't know for sure what the market will do over the next 10 or 20 years, but we can look back for some guidance on how things tend to play out. As the disclaimer goes, past results are no guarantee of future returns, but they can provide valuable perspective.

If you go back 20 years, the economy and markets were in a similar state as they are now. The dot-come bubble had burst in 2000, and investors were still feeling the pain with the S&P 500 down 23% in 2002, while the Nasdaq Composite was off 32% that year. Sound familiar? Also, the economy was not in a recession, but it had been for most of 2001 and was growing slowly in 2002.

In many ways, investors navigating the markets in Oct. 2002 were facing a very similar situation to what investors are grappling with in Oct. 2022. With that in mind, let's examine how much a $10,000 investment in the bear market of 20 years ago would have grown to by this time.

The 20-year performance of the Invesco QQQ

In this example, let's look at an ETF from the technology sector, the biggest loser of the dot-com bubble and this year as well. Specifically, we'll use the Invesco QQQ ETF (QQQ -0.29%), since it's one of the oldest technology ETFs and the largest with some $150 billion in assets.

The Invesco QQQ Trust ETF launched on March 10, 1999, and it tracks the performance of the Nasdaq 100 index, the 100 largest stocks in the Nasdaq, excluding those in the financial sector. It is heavily weighted toward technology stocks, which currently represent about 49.5% of the index. The three largest holdings are Apple, Microsoft, and Amazon.

Over the past 20 years, the QQQ has posted an average annualized return of 13% (from Oct. 25, 2002 to Oct. 25, 2022) -- including its 28% decline over the past 12 months.

If you invested $10,000 in the QQQ back on Oct. 25, 2002, you would have over $115,000 in your portfolio right now. But if you contributed an additional $100 every month to the ETF over that period, your total investment of $34,000 would be worth just under $220,000.

That may not be enough to retire on alone, but when you add in other sources of income like Social Security or contributions to an employer-sponsored retirement plan and other retirement accounts, it can be a big boost to your nest egg.

And if you have a 30-year horizon ...

It's worth pointing out how much faster your returns will further accumulate if you keep your money invested even longer. If you instead had a 30-year window to invest that $10,000 (with the monthly contribution of $100), your portfolio would grow to nearly $670,000 based on the 12.4% annual return of the Nasdaq 100 index over that period. Even with no monthly investment, it would grow to about $333,000.

As previously stated, we can't predict what the next 20 or 30 years in the market will hold, but we do know the price-to-earnings ratio of the Nasdaq 100 has come down from about 35 this time last year to 23 as of this writing -- and it's expected to fall further to 21 a year from now. Valuations are indeed lower, and growth stocks such as those in the Nasdaq 100 offer the best long-term returns. Despite the uncertainty, now is a good time to consider establishing long-term positions in quality investments like the QQQ.