The stock market isn't in the best shape; nor is the global economy. Inflation, supply chain issues, and geopolitical tensions are all contributing to the troubles on Wall Street and Main Street. Amid these issues, investors are increasingly picky about where they put their money -- and with good reason.

In these challenging times, investing in companies that can make it through severe downturns is best. Let's look at two such companies in the healthcare sector: Medtronic (MDT -0.98%) and Novo Nordisk (NVO -0.01%).

MDT Chart

MDT data by YCharts

1. Medtronic

For those looking for companies that can survive any recession, it might be worth considering corporations that have done it plenty of times before. Medical devices giant Medtronic qualifies; in its more than 70-year history, this healthcare giant has made it through many challenging periods.

History aside, though, Medtronic is well-positioned to survive a recession. Here are two reasons. First, the medical devices and equipment it markets allow physicians to perform all sorts of surgeries. Many of the company's products help patients in critical conditions. That includes, for instance, Medtronic's mechanical ventilators that aid patients with respiratory failure.

While the volume of elective surgeries dropped during the worst of the COVID-19 pandemic, "elective" is not necessarily a synonym of "optional" in this context. Elective surgeries are simply those that are scheduled ahead of time -- including some to handle very serious conditions. The pandemic created a backlog of elective surgeries, and once lockdown orders expired and vaccination rates increased, the volume of these procedures rose. 

Second, Medtronic generates solid profits and cash flow. The company racked up about $5 billion in net income in the trailing 12 months -- representing a 29.8% year-over-year increase. Medtronic's free cash flow grew by 2.1% to roughly $6 billion in the same period. Cash is king, as they say; companies with liquidity issues can have trouble handling their short-term obligations, particularly during a recession. Medtronic is unlikely to run into any such problems.

There are more reasons to consider investing in this healthcare giant. For instance, Medtronic is a Dividend Aristocrat, having raised its payouts for 45 consecutive years. The company's yield of 3.08% is well above average, and its cash payout of 56.6% is reasonable. Medtronic's dividend, like the rest of its business, looks solid, making it an excellent option for income seekers.

While Medtronic's shares have dropped by 12% year to date, they have outperformed the broader market. Investors can count on this healthcare company to remain strong even if a recession hits. 

2. Novo Nordisk

Denmark-based Novo Nordisk is one of the largest pharmaceutical companies in the world, and the company is particularly famous for its lineup of medicines that treat diabetes or obesity. As of February, Novo Nordisk held a 30.5% share of the diabetes care market, up from the 29.3% slice of the pie it had as of February 2021. That's impressive for a single company, and it also explains why Novo Nordisk will continue to generate somewhat steady revenue in the worst recession.

Lifesaving medicines aren't luxury items, especially not when they treat such serious chronic illnesses as diabetes. Patients are unlikely to cut back on these medicines. That's one reason Novo Nordisk continues to knock it out of the park with its financial results. The company's sales in its first quarter of 2022 rose 24% year over year to 42 billion Danish Kroner ($5.9 billion).

The company's net earnings per share for the quarter grew by 14% year over year to 6.22 Danish Kroner ($0.87). Novo Nordisk's strong financial results partly explain why it has easily outperformed the market this year. But the company has more up its sleeves. Consider Novo Nordisk's pipeline, which includes 13 drug trials in diabetes or obesity.

Having been a leader in this domain for several decades, Novo Nordisk is well- positioned to continue innovating. And given the rising population of diabetes patients, Novo Nordisk's main therapeutic area won't become a thing of the past anytime soon; quite the contrary. Novo Nordisk is developing medicines in many other areas, including Alzheimer's disease. The company's phase 3 pipeline features a dozen programs, eight of which are neither in diabetes nor obesity.

Assuming a modest 25% success rate for these late-stage programs, the company should be able to get at least three approvals from them. That's not to mention Novo Nordisk's early-stage clinical compounds. The company is looking to diversify its portfolio, and it should successfully do so in the next few years. In short, Novo Nordisk's prospects look attractive; The company should be able to navigate the current downturn and reward loyal shareholders in the long run.