When you are new to investing, it's all too easy to make costly mistakes. Knowing the potential pitfalls is the first step to avoiding them. Here are three to watch:

1. Taking a stock tip.

Don't do it. People with hot stock tips are rarely interested in your success. And they might be involved in so-called pump-and-dump schemes, which convince investors to buy thousands of shares of a penny stock.

Brokers might be interested in generating commissions, and professional analysts on TV might be trying to boost their holdings' prices.

Stock picking is challenging even for pros. Most investors are better off sticking with low-cost index funds and broadly diversified exchange-traded funds.

2. Waiting until the market is 'safe.'

Investors' actions during a downdraft separate the novices from the pros. Beginner investors sell stocks and refuse to invest again until the market stabilizes. This costs them huge returns. During the financial crisis, the S&P 500 bottomed on March 9, 2009. From that point, it moved higher quickly; just two years later it was up 95 percent.

Early — and consistent — investors compounded their gains further. In the eight years after the 2009 bottom, the S&P 500 increased nearly 250 percent. Missing out on that 250 percent return won't show up as a loss in an account statement, but it might be the single most costly beginner mistake. By waiting for safety you can miss out on much more upside than you would have lost on the downside.

Legendary investors get scared when the market is hitting new highs and trading at nosebleed valuations, not when stocks go down. In fact, when stocks fall 20 percent — or even 50 percent — they are mouth watering.

3. Investing money you will need soon.

This kind of investing is just speculating and market timing. The stock may well go up, but it could just as easily go down. If you are saving for a goal you would like to achieve within the next year or two, that money should stay out of the stock market and in a CD, or for more flexibility, a high-yield savings account.

True investing relies on gains from the improving business of a solid company or group of companies, and that requires time. The general rule of thumb is to leave your money in the market for at least three to five years.

If that timeline works for you, and you haven't made mistakes No. 1 and No. 2 above, you might be ready to open your first brokerage account.

James F. Royal is a staff writer at NerdWallet, a personal finance website.