The Nasdaq Composite had its best January in more than 20 years this past month, which is a promising sign for investors. The index, primarily made up of technology stocks, was up 10.7% in January, the best return in January since 2001.

It was a bit unexpected as many market watchers predicted that there could be another correction in 2023, due to projections that an economic slowdown, and potentially a recession, is possible, given the rapid rise in interest rates. That prediction may or may not come to pass, but investors should be prepared in case it does.

If the market were to go through another correction or bear market, here are three stocks to consider buying.

1. Apple

Apple (AAPL 0.52%) had a bad year in 2022, with its stock price down 26% for the year. But it did outperform the Nasdaq Composite, which fell about 33% in 2022. Part of the problem was just an overall sell-off among tech stocks, as many had become overpriced after a strong run-up in 2020 and 2021.

This year, given the strength of 2021, the quarterly numbers paled in comparison. Sales have been down as consumers faced more difficult economic conditions due to rising inflation and a higher cost of living, as well as higher interest rates. Also, the iPhone suffered from supply chain constraints due to COVID restrictions in China, where most of the phone are made. 

But the good news is that Apple's valuation came way down at the end of 2022, with a price-to-earnings ratio of around 20 -- the lowest since the start of the pandemic. After a good January, it has ticked back up to around 25, but it is still a good value at that rate.

But through a difficult past year, Apple increased its market share for the iPhone to over 50% and saw growth in its services business, which includes subscription-based products like Apple TV+. Meanwhile, supply constraints are largely gone. If the market does tank again, you will have an opportunity to buy one of the best companies in the world at an even better bargain price than you can now. 

2. Dollar General

You don't have to do a lot of research to see how Dollar General (DG -0.36%) performs in a recession or bear market -- just look to 2022. Last year, the economy shrank, or receded, in the first two quarters -- which some deem a recession. What is not in dispute is the fact that we were in a bear market in 2022 -- defined by the market dropping 20% or more.

But the thing is, through the economic downturn and bear market, Dollar General performed quite well, finishing the year up 4.4%. Since 2010, Dollar General has not had a negative year-end return, finishing in the black every year since it went public in 2009. 

With its deep discount prices and strategy of serving underserved areas, like rural locations or urban locales, Dollar General has a history of outperforming its peers during down markets, making it pretty much recession-proof.

The stock is down about 7% year to date, showing again how it tends to the opposite of how the markets move. But if the economy slides into recession and the market drops, Dollar General would be a good bet to surge higher into the headwinds of a downturn.

3. Federated Hermes

Federated Hermes (FHI -2.37%) might not be a stock you're familiar with, but it is one to know, particularly in this market environment.

Federated Hermes is an asset management firm, which might raise some red flags initially because bear markets aren't typically favorable to money managers. But Federated Hermes is one of the largest money market fund managers in the U.S. -- and money market funds make up the bulk of its assets.

As of Dec. 31, 2022, Federated had $447 billion in money market fund assets, which represented 71% of its $669 billion in total assets. It had only $81 billion in equity funds, or 12% of its total assets, while it had $87 billion in fixed income assets, roughly 13%.

With interest rates at their highest level since the Great Recession, this is a great market for money market funds, as the higher the interest rates, the higher the yields they generate for investors. In turn, they become a safe haven for investors.

Federated saw its assets reach a record of about $669 billion in 2022, with revenue up 11% for the year over the previous year. The stock price finished the year flat but is up about 11% this year.

With interest rates continuing to rise and likely to stay elevated for the next few years, Federated Hermes is well positioned to outperform, even if the market tanks again.

All three of these stocks would serve you well in the event of a market downturn -- each for a different reason.