As the famous Wall Street maxim goes, "Bulls make money, bears make money, pigs get slaughtered." The saying warns against approaching investing as if favorable conditions proceed without interruption.

The current bull market run started in March 2009, meaning we're just months away from an 11-year bull run. Even if the current bull market doesn't make it to the 11-year mark, this has still been the longest rally in U.S. history. 

That doesn't mean you should panic and dump all of your holdings. Timing the market remains incredibly difficult, and history has shown that the vast majority of investors will be best served by staying in the market, rather than attempting to predict when a crash might hit and the right time to jump back in. It's a matter of allocation.

Investors are right to be thinking about when the next recession and market crash will hit. Shifting holdings to high-quality defensive companies poised to deliver solid performance through thick and thin remains the best move. Three recession-resistant stocks, in particular, pay dividends and are worth buying this January. 

Arrows moving down and to the right.

Image source: Getty Images.

1. Walmart

While the S&P 500 index's level fell roughly 24% from 2008 through 2009, Walmart's (NYSE:WMT) share price rose roughly 12.5% -- and the retailer's market-beating performance remains similarly impressive if you compare it to the major index on a longer timeline and include dividend payments. 

WMT Total Return Price Chart

WMT Total Return Price data by YCharts

Walmart's dividend-adjusted return from 2008 through 2011 crushed the dividend-adjusted return for the broader market, and there's a good chance it will once again be resilient when the next downturn hits.

The table below charts Walmart's annual sales and earnings performance across its fiscal year ending Jan. 31, 2009, through its fiscal year ending Jan. 31, 2011 -- a period spanning The Great Recession (which kicked off in December 2007 and lasted until June 2009) and the economic malaise that lingered for years after.

Fiscal Year Revenue Revenue growth Adjusted Earnings Per Share Adjusted Earnings Growth
2009 $401.24 billion 7.2% $3.42 6%
2010 $405 billion 1% $3.66 7%
2011 $419 billion 3.4% $4.07 11.2%

Source: Walmart.

As the table shows, Walmart's business continued to post solid performance even amid the challenging economic backdrop, and it's in a good position to keep chugging when the next recession hits. 

Walmart's budget-focused model and one-stop-shop retail experience have made it the go-to big box chain for customers looking to save time and money.

If a recession hits and purse strings tighten in the U.S., that could encourage shoppers to head to Walmart over other alternatives. It also gives the company avenues to sales and earnings growth in the U.S., even if shoppers are being more careful with their money.

Walmart's progress in developing its international and e-commerce businesses should also be a boon. Shares trade at 23 times this year's expected earnings and have a 1.8% dividend yield.

2. Analog Devices

Analog Devices (NASDAQ:ADI) wasn't immune to the sell-offs that occurred at the start of the recession or the financial meltdown that hit in 2008, but it dramatically outperformed the market across the next few years on both a share-price and dividend-adjusted total-return basis.

ADI Chart

ADI data by YCharts

The company makes analog chips for functions including radio-frequency identification (RFID), microwave signal modification, and power management applications.

Analog Devices' business looks primed to enjoy a positive long-term catalyst from the growth of the 5G market. Even if a recession hits this year, 2020 will likely see dramatic advancements for the rollout of 5G technology and devices that support and rely on the the next-gen wireless networks -- and this tech shift is still very young.

Shares trade at roughly 25 times this year's expected earnings and sport a dividend yield of roughly 1.9%. The company also boasts a 15-year streak of annual payout growth -- a stretch that includes the duration of the Great Recession and the still relatively lean economic times that followed soon after.

Analog Devices' earnings multiples might look a bit steep, but its profits have been depressed this year, and performance is expected to improve going forward.

Shares are valued at roughly 21.5 times the average analyst target for 2020's earnings, and the company's sound core business and potential to see big benefits from tech trends like 5G could prove to be a positive long-term catalyst.

Technological shifts might be slowed by potential economic downturn, but tech becomes increasingly integral to other sectors every day -- and Analog Devices is positioned to benefit.

3. Brookfield Infrastructure Partners

Infrastructure needs don't simply disappear during a downturn. Brookfield Infrastructure Partners (NYSE:BIP) wouldn't be completely immune to a downturn, but most of the master limited partnership's (MLP) cash flow comes from long-term contracts or investments in predictable regulated markets. Investors can count on performance to be pretty resilient, even in the event of recession.

In the company's most recent shareholder letter, Chief Financial Officer Bahir Manios explains Brookfield Infrastructure's steady performance:  

The low volatility in our underlying results stems from the fact that 95% of our cash flows are either contracted or regulated. We operate regulated businesses in five different continents, invest in businesses with very attractive regulatory frameworks and all of that with very well-established regulators. These are in great countries like the U.K., the U.S., Australia, and Brazil.

If economic conditions hold strong, that's certainly good for Brookfield Infrastructure. However, the partnership looks well positioned to weather economic downturn, and it's been making moves with the business investments in its portfolio that should drive growth. 

Brookfield Infrastructure Partners has been selling off investments that appeared relatively mature and using the proceeds to build its positions in more fields, including telecommunications, North American rail distribution, and natural gas pipelines.  

The company is valued at roughly 11 times its funds from operations over the trailing 12-month period, a valuation that looks appealing in light of its recession-resistant portfolio structure and strong dividend component. Brookfield Infrastructure units (the MLP equivalent of shares) sport a 4% distribution yield, and the partnership has increased its payout for 12 consecutive years and boosted its dividend by roughly 755% over that stretch. 

As an MLP, Brookfield Infrastructure is subject to some specific tax rules that mean it's probably not a great fit for tax-privileged retirement accounts. Otherwise, it looks like an attractive income-generating investment that can weather volatility and deliver impressive long-term performance.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.