During the bull run of 2020 and early 2021, it was easy to be a stock picker as it seemed like everything was going up. However, the bear market that followed brought many investors back down to Earth and demonstrated that longer-term success requires a more discerning stock-picking process.

Luckily, there are many companies that make great investments even when times are tough. Some hold up well because of the industries they're in, while others are smart to buy during down markets with an eye toward reaping the benefits when Wall Street rebounds.

Here are three stocks that will be worth adding to your portfolio even when the market takes its next downturn.

Nvidia

Anyone who has invested in semiconductor stocks for any significant length of time knows the chip industry is cyclical. There are times when these companies make their shareholders feel like geniuses, and other times when owning them can feel like a mistake. One example of this dynamic that is front and center right now is Nvidia (NVDA 6.18%), which has gained 179% year to date.

A large portion of that run-up came in the wake of its earnings report for its fiscal first-quarter 2024 (which ended April 30), when it booked record data center revenue. This was attributed to the surging popularity of Nvidia's chips for artificial intelligence (AI) applications. Perhaps even more impressive than the Q1 result was Nvidia's guidance. The company expects total revenue of $11 billion in fiscal Q2, which would be a year-over-year increase of 64%.

While all of this might make investors think now is the time to pile into the stock, its valuation might give them pause. Nvidia currently trades at 41 times sales and 207 times free cash flow.

The good news is that the cyclicality of the semiconductor business means that there will likely be more opportunities to buy Nvidia stock at much better valuations during industry-specific downturns or broader market pullbacks.

CrowdStrike

No stock is entirely resistant to market downturns, but cybersecurity companies like CrowdStrike (CRWD 2.03%) might come close. Considering how vital it is for businesses to protect themselves from cyberattacks, it's unlikely any kind of market downtown would induce executives to meaningfully cut their cybersecurity budgets. 

That said, it is worth noting that CrowdStrike got dragged down pretty severely in the recent bear market. The stock is off 51% from its late-2021 high, while the S&P 500 is only down 6% over that same period. Despite being more volatile than the overall market, CrowdStrike has been performing like a business poised for a long future of success.

In its fiscal 2024 first quarter (ended April 30), CrowdStrike reported revenue growth of 42% and generated $227 million in free cash flow. The company also continues to execute on its land-and-expand model.

At this point, 62% of its customers use five or more of its modules, up from 59% in the year-ago quarter. CrowdStrike's dollar-based net retention rate has been above 120% in all but three quarters dating back to the beginning of its fiscal 2018. This means that its established customers, on average, routinely increase their spending with CrowdStrike by at least 20% each year. 

When a stock declines as much as CrowdStrike's has, it's easy to conclude that it's time to sell. However, a closer look at its business results shows that the opposite is true. Investors would be wise to take advantage of any market downturn ahead to buy CrowdStrike stock for a discount.

Walmart

Market downturns often coincide with slowdowns in the economy, and slowdowns in the economy usually mean that consumers are looking to save money. Discretionary spending categories are typically the hardest hit under those circumstances as consumers prioritize the essentials and try to acquire them at the best possible prices. That's when companies like Walmart (WMT -0.08%) shine.

Low prices are what Walmart has built its business model around -- and it works. Walmart has been a market-beating stock over its lifetime as a public company. A $10,000 investment in Walmart at its initial public offering, with dividends reinvested, would now be worth $492,000. By comparison, the same investment in the S&P 500 would be worth $256,000.

More importantly in the context of investments well-suited to market downturns, consider how Walmart's stock held up compared to the S&P 500 during the Great Recession.

^SPX Chart

^SPX data by YCharts.

This same dynamic held true in the brief but volatile COVID-induced crash of early 2020.

^SPX Chart

^SPX data by YCharts.

These charts show that market downturns are fantastic times to own and hold Walmart stock, but the company succeeds in all kinds of economic environments. In its most recently reported quarter, Walmart grew its revenue by 8% year over year.

Digging deeper, it increased its e-commerce sales by 26%, due in part to its investments in omnichannel options like delivery and in-store pickup. This is an important metric for investors to keep an eye on as Walmart continues to match the offerings of its competitors.

If Walmart can continue to make improvements on that front while continuing to sell low-cost essentials to price-conscious shoppers, its stock should remain a great buy during market downturns.