It's easy to get excited about investing in a bull market. Indexes and stocks are going strong. If you're new to investing, quick gains could encourage you to stick with it. And if you've been investing for a while, you'll be happy to see your portfolio grow in value.

Bear markets aren't so easy. Whether you're new to investing or have been buying stocks for years, it's often difficult to decide what to do next. Today, the S&P 500 Index has lost about 20% since the beginning of the year. And you may be wondering whether you should buy more stocks, sell some of your holdings, or simply sit back and wait. Which road should you take? Let's find out.

Rising inflation and economic worries

First, a bit about what's going on right now. Rising inflation, supply chain problems, the war in Ukraine, and general economic worries are weighing on investor sentiment. And some of these problems also are hurting companies.

For example, retail giant Amazon (AMZN 3.20%) says the cost of transporting goods in oversees containers has more than doubled since pre-coronavirus days. This and other higher costs weighed on earnings in the first quarter. Target (TGT 1.08%) also suffered in the first quarter due to inflation. Previously, both companies delivered solid revenue and profit growth over time.

But it's important to remember one big thing. Today's troubles won't last forever -- and strong companies have what it takes to weather the storm. History shows us that the stock market has always recovered from market downturns and crashes. And we know times of economic weakness are eventually followed by times of growth.

All of this means, in a bear market, ideally, you should hold shares of companies you believe in. And if you have the funds to invest, it's a great opportunity to add more shares of these long-term winners -- and/or add new holdings to your portfolio. You can pick up many strong, profitable companies for bargain prices.

For instance, Amazon and Target both are trading lower in relation to earnings than just a couple of years ago -- but their revenue is much higher and continues to rise.

TGT PE Ratio Chart

TGT PE Ratio data by YCharts

What about market timing?

Now, you might ask: But what if the share price losses continue in the weeks and months to come? How do I time this just right?

It's pretty much impossible to time an investment so that you buy at the very lowest point and sell at the very highest point. And since we're in this for the long term, that's OK. If you invest in great companies for at least five years, you're likely to come out ahead overall. So, if you believe in a company's story today and the price looks good, it's probably time to buy.

Now, let's talk about selling. That's rarely a good idea in a bear market. You'll miss out on potential rebounds ahead.

Of course, there may be exceptions. If you've already gained on an investment and you don't see it going much farther -- then it might be time to sell. Or if you've lost faith in a company and truly believe losses will only deepen even after the market turns around, it's probably time to exit -- and look for better opportunities elsewhere.

Your decisions right now also depend on your investment horizon and risk tolerance. If you plan on staying invested for many more years, you might want to hold onto certain higher-risk stocks -- even if you've already gained from these holdings. If your investment horizon is shorter or you aim to be more cautious, you might consider selling and locking in gains.

So, overall, in this difficult market, buying and holding are usually the best choices. They may not lift your portfolio right away. But these decisions in a bear market may help your portfolio soar over time.