If you invested $1,000 per month and earned the historic market return, how much money would you have in three decades? Believe it or not, the answer is $2.17 million. That's a life-changing amount of money.

Sound far-fetched? It's not. That's just the power of compound interest at work. 

So what's the best way to invest your money so that it can compound at those rates over time? Here's a simple plan that anyone can use to build themselves a rock-solid financial foundation.

Arrow on top of billls where the stacks are growing higher

Image source: Getty Images.

Start by paying down debt

If you carry a lot of debt, especially high-interest rate consumer debt, then it makes sense to use all of your extra $1,000 a month to focus first on debt reduction. Paying off your debt not only saves you from a massive amount of interest over time, but it can also go a long way toward reducing the amount of stress in your life. That's a win-win scenario that's too good to pass up.

So what's the best way to approach this? While there are a variety of strategies to consider, I'm a big proponent of the snowball method. The idea behind this strategy is to pay the minimum amount on each of your debts and then throw everything that you can to knock out your smallest debt first. Once that's completely gone, you can move on to the smallest remaining debt and repeat until you're debt free.

Let's look at an example that shows why paying down debt -- especially high interest credit card debt -- can so powerful. The average U.S. household that doesn't pay off their balance every month currently owes about $15,983 in credit card debt, according to NerdWallet. Meanwhile, the average annual percentage rate charged by credit cards in 2017 was just over 16%, according to creditcards.com. Quick math shows us that households with this level of debt are spending more than $2,500 each year on interest payments alone!

That's why using all of that $1,000 per month to reduce you debt balance makes so much sense. Doing so would eliminate the average credit card debt balance in about 18 months or so and would save the borrower thousands in interest.

Then build an emergency fund

Life has a way of throwing people financial curve balls when they least can afford it. Sometimes, they can be small expenses like a minor car repair, while other times, they can be major events like a job loss or a sudden health problem. Since these unforeseen events are bound to happen sooner or later, it can be advantageous to keep a pile of cash saved up so that you don't have to go into debt to pay for the emergency.

How much should you save? The prevailing wisdom is to keep at least three months of living expenses set aside -- but this number is different for everybody. If you live alone and have easily marketable skills, then three months of living expenses will probably be sufficient. However, if you have several mouths to feed and a big mortgage payment to make, then it makes sense to set aside up to six months' worth of living expenses. 

Glass jar with coins in it that says emergency

Image source: Getty Images.

In a low-interest rate environment like we've seen in the past few years, you might be reluctant to keep your $1,000 a month in the bank. However, it's important to remember that an emergency fund exists to reduce risk, not to earn big returns. Once a hardship eventually strikes, you'll be thanking yourself that you played it safe.

Invest in your retirement

Once you've knocked out all of your debt and built up a sizable emergency fund, it's time to start thinking about funding your retirement. A smart way to do this is to take advantage of Uncle Sam's generosity by focusing on tax-advantaged accounts first.

Does your employer offer a 401(k) or 403(b)? That's a great place to start, especially if your company also offers a company match. The maximum that you could contribute to a 401(k) or 403(b) in 2018 is $18,500 -- or $24,500 for those aged 50 or older -- which is more than enough to soak up all of your $1,000 a month.  That's great, as contributions to a regular 401(k) are made with pre-tax dollars,  so you'll be lightening your tax bill right away and you won't owe any taxes until you start withdrawing from the account.

Another option would be contribute to a Roth 401(k) if your employer offers that option. While you won't bank an immediate tax break for doing so you'll gain the ability to withdraw your money tax-free during retirement so long as you play by the rules.  

Senior golfer swinging club

Image source: Getty Images.

If you still have leftover money after you max out your 401(k), then its time to consider an individual retirement arrangement (IRA). For 2018, the IRA contribution limit is $5,500 per year -- or $6,500 per year if you're age 50 or older.

Broadly speaking, there are two main types of IRAs, and they feature different tax advantages. The first is a Traditional IRA. Contributions that are made to a traditional IRA may be tax deductible in the year that the contribution is made. Funds also grow tax-free but are taxed when you take money out of the account to fund your retirement.

The second option is a Roth IRA. Contributions are made to a Roth with after-tax dollars, so you won't realize an immediate tax benefit from funding them. However, once your money is inside a Roth, it can grow tax-free, and withdrawals made in retirement also are completely free of tax. In addition, you can withdraw your original contributions (but not your gains) at any time for any reason without a penalty. Money compounds with no taxes for capital gains or dividends each year.

For example, imagine that you are in the 25% tax bracket today and you decide to contribute $5,000 to a Traditional IRA. Doing so will reduce your taxable income by $5,000 this year and will save your roughly $1,250 in taxes. That $5,000 will grow tax-free, too. However, you'll have to pay taxes on withdrawals during retirement.

Had you contributed to a Roth IRA instead then you wouldn't enjoy that $1,250 tax savings up front. However, that $5,000 would still grow tax free and you wouldn't have to pay any taxes at on on withdrawals during retirement. 

So which type of IRA is the better choice for you? The answer depends on several factors such as your current tax rate and your estimated tax rate in retirement. If you're in a high tax bracket now and expect to be in a low one during retirement than a Traditional IRA probably makes the most sense since you'll save more on your tax bill today than you'll pay to withdraw the funds during retirement. If the opposite situation is true than a Roth is likely to be the smarter choice.

My personal solution to this conundrum to a hybrid approach. My wife and I contribute to both of our 401(k)s now so that we can save money on our tax bill today. We also max out our Roth IRAs each year so that we will enjoy tax-free withdrawals down the road. We feel that this is a balance that will allow us to win no matter what kind of tax bracket we find ourselves in the future.

It's worth pointing out that there are some income restrictions to keep in mind. For  Traditional IRAs, there's an upper-income limit that restricts an individual's ability to claim a tax deduction. There's also an upper-income limit on an individual's ability to contribute to a Roth IRA at all -- though there's a backdoor method that high-income individuals can use to make contributions.

Build more wealth 

With your personal finances in tip-top shape and your retirement taken care of, you can finally focus on building wealth. That's when it makes sense to put that $1,000 a month into the stock market. 

How much can that $1,000 grow over time? Here's a table that shows what this amount of monthly savings can grow into, assuming a variety of returns and time periods:

Average Return 5 Years 10 Years 20 Years 30 Years
3% $65,621 $141,694 $332,118 $588,032
5% $69,623 $158,481 $416,631 $837,129
7% $73,839 $177,403 $526,382 $1,212,876
10% $80,587 $210,374 $756,030 $2,171,321

  Table source: calcxml.com.

As you can see, the longer that you can invest that $1,000 a month and the higher the rate of return you earn, the larger your nest egg will be in time. 

But is it realistic to expect that you can earn 5%, 7%, or even a 10% annualized return? Believe it or not, it is. 

How? That's the power of the stock market. Between 1917 and 2017, the S&P 500 returned an annualized return of 10.2% if you reinvested your dividends. That's slightly higher than even the most optimistic scenario listed above.

Of course, earning that 10.2% annualized return required investors to continue to plow money into the markets throughout several brutal bear markets. Not everyone has the fortitude to handle the large ups and downs of the markets, which is why many investors choose to smooth the ride and accept a lower annualized return by keeping a portion of their wealth in less volatile assets, like bonds. 

Where to invest your money

I'm a huge proponent of buying and selling individual stocks, so you might assume that my advice would be for everyone else to do the same. In truth, I recognize that most people do not share my passion for investing and want to keep keep things as simple as possible. That's why I'm a huge believer that the majority of investors should use low-cost index funds or exchange-traded funds (ETFs) to build wealth.

What's an index fund? Unlike an actively managed fund which employs an investment manager to hand-pick securities to buy, an index fund is a passive portfolio that's designed to replicate a certain market index. Since index funds do not employ a manager they typically charge much lower fees than actively managed funds. Some index funds only charge 0.05% per year, which is far lower than the typical 1% management fee that is charged by most mutual funds. When combined with their ability to match the long-term returns of the stock market, it's no wonder why index funds have become hugely popular in recent years.

For example, the S&P 500 index consists of -- you guessed it -- 500 of the largest and most profitable companies in the U.S, weighted by market cap. Buying an index fund that tracks the S&P 500 would allow you to invest in all 500 of those companies in the same proportions that they make up in the index.

Pen drawing a line on financial paper

Image source: Getty Images.

The oldest and most well-known S&P 500 index fund is the Vanguard 500 Index Fund Investors Shares (NASDAQMUTFUND:VFINX). Investors can buy shares of this no-load index fund with an initial investment of just $3,000. This fund's expense ratio of just 0.14% also is very reasonable. Investors who can afford to invest $10,000 upfront also can buy shares of the Vanguard 500 Index Fund Admiral Shares (NASDAQMUTFUND:VFIAX) and will enjoy an even cheaper expense ratio of just 0.04%.

Another option for investors to consider is skipping index funds altogether and going with an ETF instead. Vanguard S&P 500 ETF (NYSEMKT:VOO) offers all of the same benefits of owning an index fund, but comes with an expense ratio of just 0.04%. Buying an ETF has a few benefits, such as the ability to transact during normal market hours instead of only at the end of the day with funds. ETFs also do not have minimum investment. 

But what if you do have the desire to invest in individual stocks and are willing to put in the time and effort to buy them the right way? In that case, I'll welcome you with open arms to the club. Get your $1,000 a month over to a discount broker and start building a watch-list of stocks that interest you.

How can you built out your watch-list? Here's a few ways to generate stock ideas: 

  • Look at your own buying habits. Are there any products or services that you love? Many of the best-performing stocks of the last 10 years came from companies that serve consumers and have become household names.
  • Read articles on reputable websites that focus on the stock market such as seekingalpha.com, morningstar.com, and (ahem) fool.com. 
  • Use sites like Whale Wisdom and Guru Focus to see which stocks famous investors like Warren Buffett have been buying or selling recently.
  • Use free screening tools like Finviz to identify companies that meet criteria that you find attractive. 

Once you identified a few companies that have sparked your interest then head on other to their website and look through their "investor relations" section. Read through their quarterly financial statements, listen to their conference call with analysts, and check out any recent investor presentations. Once you feel like you have a firm  understanding of the business works decide if it is a company that you want to own over the long term. If it is then buy a few shares for yourself and track their progress over time.

Keep repeating that process until you've built yourself a diversified portfolio. How many stocks does it take to be diversified? This number is different for everybody, but aiming for at least 15 stocks is a good starting point. This many stocks will allow you to reduced you portfolio risk while still being able to benefit from the upside potential if your stocks do well.

  Finally, make sure that you track your returns so that you know whether or not you're actually outperforming the index over time. If you're not, then it probably is a better idea to stick with passive investment vehicles.

Start building wealth today 

The magic of compound interest can literally turn your $1,000 a month into millions over a long enough period of time. Follow these steps to ensure that you'll truly build lasting wealth that can be enjoyed for generations to come.

Brian Feroldi has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.