If you're like millions of Americans, you've recently played the lottery and begun daydreaming about what you would do if you won. Buy a yacht? I've heard of worse ideas. Buy the mansion of my dreams? Sign me up. Travel the world? Let the passport stamping begin. Return to work? Not a chance.

But, if reality set in, and you were one of the millions who woke up having not won the lottery, have no fear -- becoming a millionaire is still very doable. Maybe not hundreds of millions of dollars like the lottery doable, but millionaire status nonetheless.

Smiling person using phone and calculator.

Image source: Getty Images.

Time is your best friend

Smart investors know that you need two things to build wealth: Time, or lots of money to begin with. Since many people don't have lump sums to invest at once, the one thing that can be on their side is time. Very few things in finance are as powerful as compound interest. It can either make debt spiral out of control or turn consistency into millions of dollars. There's a reason Albert Einstein is credited with calling compound interest the "most powerful force in the universe."

Here's roughly how long it would take to reach $1 million if you invested different monthly amounts, receiving 8% annual returns on average:

Monthly Contribution Years Until $1 Million Personal Contributions
$500 35 $210,000
$1,000 27 $324,000
$2,000 20 $480,000

Data source: Author calculations.

Although there are no guarantees in the stock market, an 8% annual return over the long term is likely on conservative side if you're investing in major indexes. For perspective, the S&P 500 returns around 10% annually on average over the long run. With those returns, you could shave years off the time it takes to reach millionaire status. Assuming the monthly contributions are the same, you could get to the millionaire threshold in 31 years, 24 years, and 18 years, respectively.

Another testament to the power of time is that with 10% average annual returns, a one-time investment could grow 10 times in value in 25 years. If you had $100,000 to begin with, you could invest it, sit back, and let the compounding effect do all the work.

Consistency is key

The stock market often rewards consistency and patience, both of which may be hard to do with pure willpower. That's why using an investing strategy like dollar-cost averaging can be very helpful. Instead of waiting until the "right" time to invest (which is essentially trying to time the market), your goal should be to make consistent investments over time, regardless of stock market conditions. And that's what dollar-cost averaging is. You set a specific investing schedule and stick to it no matter what.

You could decide that you want to invest $250 every Monday. When Monday comes around, and prices are down, invest. When Monday comes around, and prices are up, invest. When Monday comes around, and prices are flat, invest. Stick to the schedule you set, barring unforeseeable financial issues.

"Time in the market is better than timing the market" is conventional investment wisdom that has stood the test of time, and for a good reason: It's the truth. Instead of trying to predict the unpredictable, stay the course, and watch how you can be rewarded in the long run.