No investor is perfect, and all of us will likely end up making an investment decision we'll regret in the future. That's just how it goes. However, there are some mistakes many people have made in the past that you can learn from and avoid. Here are three critical investing mistakes to avoid at all costs right now.

1. Investing without having an emergency fund

Investing is important, there's no denying that fact. However, what's more important is having some financial security in case things go awry in your life. That's why before you begin investing, you should always try to have an emergency fund saved up. To get an idea of how much your emergency fund should be, you should first calculate your monthly expenses. From there, your goal should be to save three to six months worth of expenses.

If you're single and essentially only responsible for your own livelihood, you can likely get away with having three months of expenses saved up. If you have a family, you'll want to aim to have at least six months worth saved up, just to be on the safer side.

You never know when life will take a turn. Your car could break down, your house may need a repair out of nowhere, you could suddenly get laid off; whatever the case, having some peace of mind that comes with financial security is invaluable. And you don't want to be in a situation where you have to sell your stocks to cover these costs because you could either find yourself selling for a loss or exposed to a tax bill.

A person writing at a desk in a home office with sun shining through the window.

Image source: Getty Images

2. Investing entirely in individual stocks and not index funds

One of the key pillars in investing is diversification. You never want all your eggs in one basket, and you never want the success (or downfall) of your portfolio to depend on too few companies. One of the best ways to achieve diversification is through index funds. Take an index fund like one that tracks the S&P 500, for example. The S&P 500 consists of the largest 500 publicly traded U.S. companies and covers any sector you can imagine. If you invest in an S&P 500 index fund, you're essentially receiving instant diversification.

If you were to try to achieve the same type of diversification that comes with an S&P 500 index fund, you would have to not only research different industries, their risk factors, and future outlooks, but you would also have to research companies within these industries to determine which ones you want to invest in. That's a lot of time and effort that, in all honestly, a lot of people don't have and don't want to exert.

There are index funds that focus on many different aspects of investing. Whether it's company size, industry, or ESG objectives, there's an index fund that can suit your investing needs. Utilizing different index funds can add diversification and help reduce some of the risks in your portfolio.

3. Trying to time the market

Investors may think they can time the market, but the harsh reality is they can't. You may do it in the short term, but timing the market consistently over the long run is virtually impossible. There's a reason for the saying, "Time in the market is more important than timing the market." That's because it's true. Instead of trying to time the market, you should take a dollar-cost averaging approach.

When you dollar-cost average, you invest at set, regular intervals, regardless of the prices of your stocks at the time. Sometimes, you may buy stocks right before prices rise. Other times, you may buy them right before prices drop. Either way, the idea is that you take some of the emotions out of it and stick to your schedule regardless.