The secret to retiring a multimillionaire isn't a mystery. The key is discipline and consistency. One of the best ways to build long-term wealth is through dollar-cost averaging with exchange-traded funds (ETFs), and you can start with as little as $500.

Over the past few decades, the stock market has largely been driven by companies at the forefront of innovation. That's why investing in an ETF that gives you solid exposure to companies at the forefront of artificial intelligence (AI) and other technologies can be a smart move.

One of the best ETFs in that regard is the Invesco QQQ Trust ETF (QQQ 0.12%). Here's why.

Why the Invesco QQQ stands out

The Invesco QQQ tracks the performance of the Nasdaq 100, which comprises the 100 largest non-financial companies listed on the Nasdaq Stock Exchange. Unlike broader market ETFs, like those tracking the S&P 500, the Invesco QQQ has a clear tilt toward technology and growth stocks. Its focus on these areas has paid off, as over the past 10 years, the ETF has delivered a total return of 445%, compared to 260% for the S&P 500 (as of the end of July).

It hasn't just been a lucky stretch either. The fund has outperformed the S&P 500 in rolling 12-month periods 87% of the time in the past decade.

The Nasdaq has long been the exchange on which leading and emerging technology companies tend to list their shares when they go public. That's why the ETF's top holdings are dominated by the world's largest tech companies. At the end of June, more than 60% of its holdings were in the tech sector, while nearly 20% were in the consumer discretionary category.

Many of these companies are at the forefront of AI, advanced semiconductors, robotics, cloud computing, and other technological innovations. With AI still in the early stages of adoption, these leaders are well positioned to keep driving growth for years to come.

Given that the Nasdaq 100 is a market-cap-weighted index, the ETF lets its winners run. That means when companies like Nvidia or Microsoft outperform, their weightings increase, helping lift the entire index. This is one of the main reasons the Invesco QQQ has been able to consistently outpace the broader market.

Artist rendering of AI in the brain.

Image source: Getty Images.

The power of dollar-cost averaging

Investing $500 in the Invesco QQQ ETF is a solid first step, but it's just that, a first step. The key to building real wealth is investing consistently in the ETF over a long period of time through dollar-cost averaging. That could be every month or every paycheck, but you want to invest a set amount at regular intervals. This eliminates the need to time the market, which often doesn't work out the way you'd expect.

If you'd invested $500 a month into the Invesco QQQ ETF over the past 30 years and saw returns similar to the past decade's 18.5% annual average return, you'd be sitting on more than $5.7 million today. Even smaller amounts, like $100 a month, could be worth more than $1 million at those types of returns. The key is sticking with it through both bull and bear markets alike.

One of the big reasons that dollar-cost averaging works is that it helps keep emotions in check. When a market is near all-time highs, you may not want to invest over fears that it won't climb higher, but a J.P. Morgan study found that the market actually hits a new high about 7% of all trading days. And about one-third of the time, it never goes lower. At the same time, when the market starts to trade lower, many investors freeze and get scare to add new money. Putting your future investment buys on autopilot solves this issue.

ETFs are one of the best vehicles for dollar-cost averaging because they provide instant diversification without requiring you to pick individual stocks. The Invesco QQQ ETF, meanwhile, is well positioned for the future, given its focus on growth and technology stocks. With AI looking like it could still be in its early innings, this is a great ETF to buy and continue to invest in over the long term.

While the market is near all-time highs, the smart move is not trying to find the perfect entry point, but simply starting to invest. Dollar-cost averaging and the power of compounding will do the rest.