The stock market can be intimidating at times, but investing is one of the easiest and most effective ways to generate long-term wealth.

You also don't need to be a rich or experienced investor to start making money in the stock market. With a smart strategy and the right investments, you can turn $3,000 into $84,000 or more with next to no effort. Here's how.

The secret to making money in the stock market

There's no safe way to get rich overnight by investing. But with enough time and consistency, you can earn hundreds of thousands of dollars -- or potentially more than $1 million.

Through the help of compound earnings, your money can grow exponentially the more time it has to grow. With compound earnings, you're earning returns not just on your initial investment but on your total account balance. The more you earn, the faster your savings will accumulate.

Because compound earnings are so powerful, you don't need to invest a lot of money to see substantial growth over time. But the longer you can keep your money in the market, the more you stand to earn.

The right investment for building wealth

The types of returns you'll earn on your investments depend on where, specifically, you invest. There's not necessarily a right or wrong way to invest, because it will depend on your risk tolerance and personal preferences.

One of the safest and simplest options, though, is an S&P 500 ETF -- such as the Vanguard S&P 500 ETF (VOO -0.84%) or iShares Core S&P 500 ETF (IVV -0.87%), for example.

An S&P 500 ETF tracks the S&P 500 itself, meaning it includes the same stocks as the index and is designed to mirror its performance. The S&P 500 contains stocks from 500 of the largest and strongest U.S. companies, making this ETF a powerhouse (yet low-risk) investment.

Historically, the S&P 500 has earned an average rate of return of around 10% per year. While its yearly returns often fluctuate wildly, all the ups and downs have averaged out to around 10% per year over decades.

If you were to invest $3,000 right now while earning a 10% average annual return and simply let your money sit, it would grow into around $84,300 after 35 years -- assuming you made no additional contributions in that time.

Supercharging your savings

While $84,000 is a fair amount of money, you could make a lot more by investing a little each month on top of your initial contribution.

Again, thanks to the beauty of compound earnings, you don't need a lot of cash to get started. Say, for example, you invest your initial $3,000 plus $100 per month. Assuming you're still earning a 10% average annual return, here's approximately how much you'd accumulate over time:

Number of Years Total Savings
25 $150,000
30 $250,000
35 $410,000
40 $667,000

Source: Author's calculations via Investor.gov.

The more you're able to invest each month, the more you can potentially earn. For example, if you were able to contribute an additional $300 per month, all other factors remaining the same, you could accumulate just over $1 million after 35 years. With $500 per month, that number goes up to $1.7 million.

The key to building wealth in the stock market is to start early and invest consistently. Even if you can't afford to invest much right now, just a small amount of money can add up substantially over time thanks to compound earnings. But the longer you wait, the harder it will be for your savings to grow.

It's easier than you might think to make a lot of money investing, but time is your most valuable asset. The sooner you get started, the more you can earn.