Getting started investing can be a daunting task. The good news is, you are probably young enough to have plenty of time to make mistakes and recover some of the losses from those mistakes. That said, getting a good start from the start can set you up for a very prosperous investing journey.

If I had $5,000 to invest and was starting from scratch, I'd follow a very simple strategy. Instead of focusing on generating sexy market-beating returns, I'd devote most of my attention to how I can optimize the tax efficiency of my investments. I know, it sounds boring, but saving money on taxes can produce excellent returns.

Two people looking at a laptop in a conference room.

Image source: Getty Images.

Get your money in tax-advantaged accounts

There are three main types of tax-advantaged accounts to consider as a beginning investor: an employer-sponsored retirement plan like a 401(k), an individual retirement account (IRA), and a health savings account (HSA). You may not have access to all of those accounts, but you'll at least have access to an IRA.

All of these accounts can provide instant tax savings in the form of a deduction on your tax return in the year you make a contribution. You'll have to pay income tax on the distributions in retirement, though. You may also elect a Roth option for an employer-sponsored plan or IRA. With a Roth account, you'll pay taxes today, but distributions from the account are tax-free. A Roth option may be better for someone with a low tax rate and a long investment horizon. 

Here's how I would prioritize investing $5,000:

  1. Save in a 401(k) (or other employer-sponsored plan) up to the company match. Many employers offer a matching contribution based on a percentage of your salary. If you don't max out the employer's match, you're forgoing part of your entitled compensation. But you may not want to contribute any more than the amount necessary to max out the match at first because 401(k) plans often have relatively high fees.
  2. Save in a health savings account up to the maximum contribution. You can only contribute to an HSA if you're enrolled in an eligible health insurance plan. HSA contributions are tax-deductible in the year you make the contribution, and you can withdraw funds tax-free if you're paying for qualified medical expenses. If you can make a direct contribution from your payroll, you'll save on FICA taxes, too. The maximum individual contribution for an HSA in 2021 is $3,600, and it climbs to $3,650 in 2022.
  3. Contribute to an individual retirement account. If you have a very low tax rate where you live, you may also want to consider a Roth IRA. An IRA will usually be the least expensive type of account with the most investment options.

Investing in a tax-advantaged account also means you won't pay capital gains taxes when you sell your investments. That gives you a lot of wiggle room to change course if you need to sell your investments (which, hopefully, won't happen).

It's important to note, however, that investing in one of these accounts can lock up your funds until retirement age. While there are ways to access the money in retirement accounts well before retirement, it's not as easy as getting money out of a standard brokerage account. The tax savings can be worth the hassle, though.

What to buy in your investment account

Once your $5,000 is in your account, you need to invest in something that will appreciate in value. As someone just starting out, your best option is to direct the funds toward a simple broad-based index fund. An index fund is designed to track the returns of a market index and the fees associated with these types of funds are extremely low.

Using a fund that tracks the S&P 500 index or a broader total stock market index will ensure you match the market returns. That's all you're trying to do as a beginning investor. Trying to beat the market with deep analysis or complex strategies can come later after you understand the mechanics of investing. One step at a time.

You may have limited options in your employer-sponsored plan or HSA, but you should be able to find at least one suitable option. In an IRA, you'll have your pick of the best S&P 500 index funds. And remember, if you decide you want to try something different, you can sell your shares and move them to a different investment option without any tax consequences later.

Investing your first $5,000 is a learning experience. Take the time to learn about all the investment accounts available to you, and keep your investments as simple as possible at the beginning.