The economy today is in a strong position, but you wouldn't be able to tell that by observing the S&P 500's 6% decline in January. With the Federal Reserve stating its intention to raise interest rates this year to pump the brakes on soaring inflation, investors could be worried that an economic slowdown is possible in the not-too-distant future. In that case, figuring out how to position your portfolio is a top priority.
Let's look at why Costco Wholesale (NASDAQ: COST), Home Depot (NYSE: HD), and O'Reilly Automotive (NASDAQ: ORLY) are three stocks you'll want to buy during a recession.

Image source: Getty Images.
1. Costco
Selling everything from groceries and electronics to furniture and jewelry at some of the lowest prices around, warehouse-club operator Costco makes for an extremely low-risk investment during economic downturns, a time when people look to stretch their budgets as much as possible.
After the pandemic first struck the U.S. in March 2020, consumers flocked to their nearest Costco location to get all of their shopping done in one trip. And the growth still hasn't fallen off. In the month of December, Costco grew same-store sales, or comps, 14.5% year over year.
Costco's massive scale and resulting purchasing power -- with $196 billion in fiscal 2021 revenue and 828 warehouses -- afford it the ability to negotiate favorable terms with vendors. But because the business keeps prices as low as possible, its margins on merchandise sales are intentionally slim. Costco's 62.5 million membership households (as of Nov. 21, 2021) are the solution, driving customer engagement and loyalty, and providing the company with stable, recurring revenue.
If another recession is on the horizon, I'm certain that Costco will continue to be a top shopping destination. This makes it a no-brainer stock to own during tough times.
2. Home Depot
Another top-notch retail stock to consider in an economic downturn is home-improvement giant Home Depot. What makes this business, which generated trailing-12-month sales of $148 billion, particularly appealing is that it serves both do-it-yourself (DIY) and professional customers extremely well.
At the onset of the pandemic, the DIY segment saw a surge in demand as people took on simpler projects. But over the past three quarters, the pro business has outpaced DIY, demonstrating homeowners' renewed comfort with strangers coming into their homes to complete complex renovations. This flexibility is key when the economy takes a turn.
In a weak economy, people are less inclined to consider moving and instead will focus on renovation projects to improve their living quarters. Management's goal to "lead the market down and lag going up" when it comes to pricing strategy shows how the company focuses intensely on offering customers as much value as possible.
As a result, Home Depot is a safe and dependable business for investors to own in both good and bad economic times. The company is a critical part of the housing industry, reliably there for customers and whatever projects they need to complete. And the stock has been a huge winner, soaring 163% over the past five years.
3. O'Reilly Automotive
Perhaps the most recession-proof company on this list is O'Reilly Automotive. The aftermarket auto parts chain has proven its all-weather appeal, especially during the financial crisis more than a decade ago. In 2008 and 2009, revenue jumped 41.8% and 35.5%, respectively, year over year. If another recession happens in the near future, shareholders have absolutely nothing to worry about.
People will look to extend the lives of their existing vehicles as opposed to buying new ones when the economy takes a turn for the worse. We still need to get to work and school as well as complete errands, all of which require a functioning car. This sense of customer urgency puts O'Reilly and its 5,740 domestic stores in a beneficial position to serve their needs.
What's more, strong industry tailwinds should support the company's growth in the years ahead. Americans drive more miles each year, and the average age of vehicles on the road continues to climb. Both create increased wear and tear on cars, a boon for O'Reilly's business.
For 2021, same-store sales are expected to rise between 10% and 12%. Meanwhile, the gross margin is expected to exceed 52% and free cash flow should top $2 billion -- superb financial metrics by any measure.
10 stocks we like better than Costco Wholesale
When our award-winning analyst team has a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.*
They just revealed what they believe are the ten best stocks for investors to buy right now... and Costco Wholesale wasn't one of them! That's right -- they think these 10 stocks are even better buys.
*Stock Advisor returns as of January 10, 2022
Neil Patel has no position in any of the stocks mentioned. The Motley Fool owns and recommends Costco Wholesale and Home Depot. The Motley Fool has a disclosure policy.
The views and opinions expressed herein are the views and opinions of the author and do not necessarily reflect those of Nasdaq, Inc.