Have you checked your 401(k) lately? If you haven't, that's probably a good thing, as you may not like what you see. I have certainly avoided checking my retirement accounts over the past few months. The S&P 500 is down 19% year to date as of May 20, and the Nasdaq Composite has lost 28% -- that's near or in bear market territory, depending on which index you follow.

While it's tough to see red numbers seemingly every day, it's important to keep in mind bull markets typically last longer than bear markets, and having a long-term focus is the best strategy to produce gains. And avoiding these three common mistakes will help you get the most out of your 401(k)

Person facepalming in front of laptop.

Image source: Getty Images.

Mistake No. 1: Not getting the full company match

This seems like a no-brainer, but you might be surprised how many people don't get the full company match on their 401(k) plan. A 2015 study by Financial Engines found that 25% of plan participants don't get the full company match, leaving a combined $24 billion on the table. Those earning $40,000 or less (42%) and under 30 years old (30%) were most likely not to get the full match.

While not all companies offer a match, many employers typically will match anywhere from 2% to 6% of an employee's salary as contributions to their 401(k). So if your company matches 4% of your annual salary, and you contribute only 2% to your plan, you are missing out on free money.

Let's say you make $50,000 per year and you contribute 2% of your salary to your plan -- that's $1,000. If it is a dollar-for-dollar match (some companies offer a partial match), your employer would also contribute $1,000, so you'd have $2,000 invested in your portfolio. But if you had gotten the full 4%, you'd receive $2,000 from your employer.

Now, let's see how much you are missing out on over time. If you are 30 and contribute 2% of your salary for 32 years until retirement, got a 3% annual raise, earned an average annual return of 10%, and received a matching $1,000 contribution from your employer each year, you'd have about $558,000 by age 62. If you contributed 4% and got the full 4% company match, you'd have $1.1 million by the same age.

Mistake No. 2: Waiting too long to invest

When you're just out of high school or college and get that first full-time job in your field, you're probably not thinking about retirement. Rather, at an entry-level salary, you may feel like you need every red cent for expenses in the here and now. It's not uncommon for people in their 20s to skip investing in their 401(k) for a while. One survey by Morning Consult a few years ago said only 39% of those in their 20s invested for retirement, while a survey from Nationwide said the average age Americans start to invest in their retirement is 31.

Just as not getting the full company match would cost you hundreds of thousands of dollars over time, so can starting too late to invest in your 401(k). Let's do the math. In the hypothetical above, the person started contributing to their 401(k) at 30, which is about average. But let's say you start at 25. What difference would those five years make?

Well, your salary would likely be lower, so let's plug in the numbers based on a salary of $45,000, with a 3% annual raise. Let's also say you are contributing 4% and getting the full company match with an average annual return of 10%. And like the above scenario, you are retiring at 62. You would have nearly $1.7 million after 37 years -- about $600,000 more than if you waited to start at age 30.

Mistake No. 3: Not paying attention to fees and diversification

Each investment in your 401(k) comes with fees attached -- some more than others. There are two things to check. One is if the fund charges a load -- or commission -- for investing or selling. This is typically a one-time fee charged when you buy the fund or sell it. Ideally, you want a no-load fund. The other is the expense ratio. This is an annual fee charged to cover operating costs, which comes out of your investment return. Index funds have lower expense ratios with some as low as 0.02%. That means you pay just $2 per year in fees for every $10,000 invested.

Index funds and exchange-traded funds (ETFs) typically have lower expense ratios, because they are passively managed and generate returns based on the indexes. Actively-managed funds, led by a portfolio manager, are typically more expensive with fees typically ranging from 0.50% to 1.50% -- or higher. A fund with an expense ratio of 1.00%, for example, would take $100 from your returns every year for every $10,000 invested.

During the long bull market of the 2010s, people flocked to index funds and ETFs, because the indexes were flying high, and these funds had low fees. When indexes are down, actively-managed funds may be preferable if they are beating their benchmarks and justifying those higher fees.

Finally, there are many good resources from the Fool that go in depth on how to diversify your portfolio and allocate assets for the best long-term returns. As a general rule, the further away you are from retirement, the more aggressive your portfolio should be as you have more time to bounce back from swoons like we are seeing now. As you get closer to retirement age, you may want to become gradually more conservative to limit the effect of volatility.

But avoid the temptation to react in the short-term and panic trade, because when you do that, you are not only locking in losses; you are missing out on the returns when the market inevitably bounces back.