Stock charts make it easy to see how the market's doing at any given time — green means up, red means down — and during a bear market, it's generally red as far as the eye can see.

For many people, the color red means one thing: stop. But to stop investing generally is a bad idea when the market gets scary. Worse yet? Selling stocks out of fear.

Given that bear markets, defined as declines of at least 20 percent in asset prices from a recent high, are somewhat inevitable, here are some tips for how to make the most of investing during these times.

Make dollar-cost averaging your friend

Say the price of a stock in your portfolio slumps 25 percent, from $100 a share to $75 a share. If you have money to invest — and want to buy more of this stock — it can be tempting to try to buy when you think the stock's price has cratered.

Problem is, you will likely be wrong. A more prudent approach is to regularly add money to the market with a strategy known as dollar-cost averaging. This helps smooth out your purchase price over time, ensuring you don't pour all your money into a stock at its high (while still taking advantage of market dips).

If you shift your perspective, focusing on potential gains rather than potential losses, bear markets can be good opportunities to pick up stocks at lower prices.

Diversify your holdings

Speaking of picking up stocks at lower prices, boosting your portfolio's diversification — so it includes a mix of different assets, including stocks, bonds and index funds — is another valuable strategy, bear market or not.

During bear markets, all the companies in a given stock index, such as the S&P 500, generally fall — but not necessarily by similar amounts. That's why a well-diversified portfolio is key. If you are invested in a mix of relative winners and losers, it helps to minimize your portfolio's overall losses.

If only you could know the winners and losers in advance, right? Because bear markets typically precede or coincide with economic recessions, investors often favor assets during these times that deliver a more reliable, or steady, return — irrespective of what's happening in the economy.

Often referred to as a "defensive" strategy, such an approach might mean loading up on the following stock types:

• Shares of noncyclical companies. These companies don't see a precipitous fall in demand if the economy's in trouble, because they sell essential goods or services like food, health care or utilities, for example.

• Dividend-paying stocks. Even if stock prices are not going up, many investors still want to get paid in the form of dividends. That's why companies that pay higher-than-average dividends (including utilities) will be appealing to investors during bear markets.

•  Bonds are an essential component of any portfolio, but adding more money to these assets may help ease the pain of a bear market.

Focus on short-term strategies

If you can't stomach watching the value of your portfolio plummet during a bear market, it may be best to ignore it. That's right, don't log into your account — just let it be.

In a bear market, just like in normal times, continue adding money to your retirement vehicle, a 401(k) or IRA; experts recommend a target of about 15 percent of your gross income. With savings beyond that amount, it's perfectly fine to focus on short-term goals. If you have a life event coming in the next five years — buying a home, sending a child to college or retiring — it's best to keep that money out of the stock market anyway.

Short-term strategies are good for just that — the short term. In 2018, for example, high-yield savings accounts delivered higher returns than the major stock indexes. But the stock market's still the long-term winner, with the S&P 500 delivering average annual returns of about 10 percent.

When saving for the short term, make sure your vehicles deliver a competitive return. Certificates of deposit should be around 2 to 3 percent. High-yield savings or money market accounts should be around 1 to 2 percent. Peer-to-peer lending's potential annual return is between 3 to 8 percent.

Be patient

Bear markets test the resolve of all investors, professionals included. While these periods are difficult to endure, history shows you probably won't have to wait it out too long. Bear markets tend to be shorter than bull markets (1.4 years, on average, vs. 9.1 years) and less severe (with average cumulative losses of 41 percent compared with average cumulative gains of 470 percent-plus), according to data compiled by First Trust Advisors.

Anna-Louise Jackson is a writer at NerdWallet. E-mail: ajackson@nerdwallet.com. Twitter: @aljax7.