No one knows how long the economic pain will last in our current recession. This is particularly true because the COVID-19 pandemic puts us in uncharted waters. So this is a good time to evaluate your holdings and see which stocks should do well in a downturn.

These three companies are offering everyday necessities that people will continue buying, regardless of the state of the economy. Let's dig in.

The word opportunity is in the center and under a magnifying glass surrounded by the word crisis.

Image source: Getty Images.

1. Kroger

Kroger (NYSE:KR), a nearly-140-year-old supermarket operator, has survived world wars, the Great Depression, and numerous recessions. It's no wonder Kroger does well in these conditions. Demand for groceries (as well as pharmacies and gas stations, which many locations also offer) does not dip when people lose their jobs. In fact, consumers are more apt to eat at home rather than dine out. You can see this by the company's strong results for its fiscal first quarter (ended May 23). Its same-store sales (comps), excluding fuel, rose 19%. Kroger's operating profit under U.S. generally accepted accounting principles (GAAP) increased by 47% to $1.3 billion from last year's $901 million.

Looking further back to the previous recession, Kroger's comps rose 5% and 2.1% in 2008 and 2009, respectively.

Showing confidence in its future and reflecting its consistent results, Kroger's board of directors recently raised the quarterly dividend from $0.16 to $0.18, starting with September's payment, which is a 2% dividend yield at Friday's closing price. With a payout ratio of 24%, meaning less than one-quarter of the company's earnings go toward the dividend, Kroger has ample room to pay higher dividends. This also marked 14 consecutive years the company has increased its payout.

2. General Mills

General Mills (NYSE:GIS) is a consumer staples company that sells cereals, snacks, and yogurts under well-known brands like Cheerios, Fiber One, and Yoplait. This is another company that will likely benefit from fewer people eating out -- it's not surprising that its sales surged in the fiscal fourth quarter (ended May 31) as COVID-19 forced governments to issue stay-at-home orders and close restaurants. Revenue rose 16% after removing the effects from an extra week this year and foreign currency translations.

This is not merely a one-quarter phenomenon. On General Mills' fourth-quarter earnings call, CFO Kofi Bruce said: "We expect consumer concerns about COVID-19 virus transmission and the potential for a protracted recession will drive some level of elevated food demand at-home this year, relative to pre-pandemic levels."

Turning to the last recession as a guide, General Mills' sales went from 2007's $12.3 billion to $14.6 billion in 2009.

3. Colgate-Palmolive

Colgate-Palmolive (NYSE:CL) is another venerable company (over 200 years old) that sells goods whose demand does not depend on the economic cycle. These include toothpaste and toothbrushes, soap and deodorant, dishwashing liquids and detergents, and household cleaners. It sells these under popular brands such as Colgate, Palmolive, Irish Spring, and Speed Stick. These products account for more than 80% of the company's sales. The remaining sales come from its pet nutrition business, which sells dog and cat food. With people's strong feelings about their pets, this also does well in hard economic times.

Colgate's second-quarter adjusted sales increased by 5.5%. Some of this was from higher demand for certain products during the pandemic. But, looking at the first quarter when COVID-19 had less of an effect, its sales grew 7.5% compared to the same period the year before.

With 70% of the company's sales coming from outside the U.S., Colgate offers investors good geographic diversity, which should also help as countries' economies recover at different rates.

You can also enjoy your dividends coming in. Colgate has paid one since 1895, raising it for 57 consecutive years, putting it in the elite Dividend King status (an S&P 500 company that has increased dividends for at least 50 straight years). This includes when it hiked May's payment by a penny to $0.44, offering a 2.2% yield based on Friday's closing price.

Colgate's free cash flow easily supports its dividends. In the first half of the year, its free cash flow (operating cash flow minus capital expenditures) was $1.6 billion, while it paid $784 million in dividends.