This year has been a wild ride, to put it mildly. The stock market experiences some ups and downs every year, but in 2020 the market shattered records and saw extreme volatility.

While the stock market has largely recovered from its significant downturn at the beginning of the COVID-19 pandemic, it has taught investors some valuable lessons over the past year. And no matter what 2021 has in store, these lessons can help your money reach its full potential.

Hundred dollar bill with mask on it

Image source: Getty Images.

1. Keep investing even when the market crashes

Although financial experts advise against panic-selling when the market starts to tumble, it can be difficult to keep your composure during periods of volatility. Especially earlier this year when the S&P 500 dropped by more than 30% in just a few weeks, it may have been tempting to sell your investments before the market can fall any further.

But if you had stopped investing when the market dropped, you would have missed the remarkable recovery that occurred almost immediately afterward.

^SPX Chart

^SPX data by YCharts

The stock market is going to experience turbulence from time to time, and if history shows us anything, it's that the market is always able to recover no matter how bad things look. So the next time the market starts to fall, try your best to keep calm, continue investing, and focus on the long term.

2. An emergency fund is critical

Tens of millions of Americans lost their jobs due to the COVID-19 pandemic, and there was never a better time to have a solid stash of emergency savings.

It's easy to overlook an emergency fund when times are good. When you're steadily employed and can afford to pay all your bills, an emergency fund doesn't seem necessary. But you can't wait until disaster strikes to set aside some savings, because by then it will be too late.

If you lose your job or are hit with an unexpected expense and you have no emergency savings, you might be forced to pull your money out of the stock market. Not only could that result in penalties and taxes, but you could also be losing money on your investments if you withdraw during a bear market.

This year has proved that it's impossible to predict when you might need an emergency fund to fall back on, so it's smart to start saving now. Aim to set aside enough cash to cover at least three to six months' worth of expenses, so you'll be as prepared as possible for unexpected emergencies.

3. Timing the market is nearly impossible

Timing the market involves buying and selling investments at just the right moment to avoid losing money. If you buy when stock prices are at rock bottom and then sell when the market peaks, you can theoretically make a nice profit.

However, while timing the market sounds like a smart idea on paper, it's nearly impossible to pull off in real life. This year has been unpredictable, and at times it's been difficult to understand why the market behaves the way that it does.

Case in point: Shortly after the National Bureau of Economic Research announced that the U.S. was in a recession back in June, the stock market experienced record-breaking highs. If you had sold your investments in June predicting the market would crash, you would have missed out on tremendous growth.

Instead of trying to time the market, it's better to take a long-term investing approach. Focus on building a portfolio of solid investments that have a track record of surviving tough economic times, and hold onto those investments for as long as you can. When you maintain a long-term outlook, it won't matter what the market does tomorrow, next month, or next year -- so you won't need to worry about how short-term volatility will affect your investments.

This year has been rough for millions of Americans, but it also taught us plenty of valuable lessons. By keeping these lessons in mind as we head into 2021, you can make better investing decisions and set yourself up for a brighter financial future.