With the U.S. presidential election just around the corner, tensions are running high. Investors are also feeling that tension, as many Americans worry about what the future holds for the stock market and how the outcome of the election could affect their investments.

While nobody knows exactly how the election will turn out or how it will affect the stock market, there are three investing mistakes you should avoid no matter what happens.

Voting buttons on an American flag.

Image source: Getty Images.

1. Panic-selling your investments

Pulling your investments out of the stock market just before the election may seem like a good way to limit your risk, but it could ultimately do more harm than good.

When you withdraw your money from the stock market, you typically face various penalties. Pulling your savings out of your 401(k) or traditional IRA before age 59 1/2, for example, results in a 10% penalty and income taxes on the amount you withdraw. If you're withdrawing all your investments, that can amount to a hefty chunk of change.

In addition, trying to time the market can be detrimental to your investments. If you're going to sell, you'd need to sell at just the right moment before the market takes a turn for the worse to avoid losing money. But the only thing certain about the stock market is that it can be wildly unpredictable, so trying to find the right opportunity to sell can be nearly impossible.

2. Pressing pause on investing because you're worried about volatility

If you choose not to sell your investments, you may be tempted to simply stop investing instead. When the market is volatile, it's human nature to want to limit your risk. But by pressing pause on investing until the stock market stabilizes, you could be missing out on potential gains.

Market downturns are often some of the best opportunities to invest. Stock prices are lower when the market is down, making it a great time to invest in quality stocks at bargain prices. Then once the stock market recovers and prices rebound, your stocks will suddenly be worth much more than you paid for them. If you sit out this election season because you're worried about investing when the market is down, that could potentially cost you.

3. Not investing for the long term

The key to surviving any stock market downturn is to focus on long-term investments that are more likely to survive tough economic times. That's because when you invest for the long term, it doesn't necessarily matter what happens in the next month, year, or four years.

Regardless of what may be going on in the world, the stock market has always managed to bounce back. Even after the market experienced one of its worst quarters in history earlier this year at the start of the COVID-19 pandemic, it saw record highs just months later. In fact, the S&P 500 is currently up nearly 7% since the beginning of the year despite falling roughly 30% in March.

^SPX Chart

^SPX data by YCharts

It's true that the market could potentially take a tumble after the election. But if history proves anything, it's that the stock market can recover from even the worst falls. As long as you're focusing on the long term and not getting caught up in short-term trends, your investments should bounce back regardless of what happens with the election.