Stocks have come under pressure as inflation runs rampant and the Federal Reserve takes aggressive action to bring it back under control. What worked over the past few years for investors just isn't working anymore.

One thing that tends to work in the long run is buying shares of high-quality companies that pay solid, reliable dividends. While the stock market could continue to suffer, it looks like a great time to pick up some shares of AT&T (T 1.30%), International Paper (IP 0.57%), and Hanesbrands (HBI 0.43%).

AT&T

Telecom giant AT&T is out of the media business. It's spin-off of Time Warner is complete, and now the company can focus on its core wireless and fiber businesses.

The stock market never liked AT&T's foray into media, but it apparently also doesn't like the company's exit from the media business. AT&T stock has been slumping for the past few months, knocking the market capitalization down to around $120 billion.

To be fair, AT&T did cut its dividend after the spin-off, and it did lower its free cash flow guidance for the year as customers started delaying payments in a tough economy. But even so, AT&T's valuation is extremely pessimistic. The dividend currently yields 6.7%, and the stock trades for just 8.5 times the depressed outlook for 2022 free cash flow.

AT&T will certainly suffer in a recession as customers push back phone upgrades and potentially trade down to cheaper wireless plans. But those are short-term issues. As free cash flow rebounds in the coming years, driven by the investments AT&T is making in 5G and fiber, the current stock price is going to look like an impossible bargain.

International Paper

A disastrous earnings report from FedEx has sent shares of some related stocks tumbling. The delivery specialist withdrew its full-year guidance, saying that it was caught off guard by how quickly its business had deteriorated. International Paper felt the sting of FedEx's warning. Shares of the paper and packaging giant slumped in reaction to the FedEx news, losing about 18% of its value over the span of a week or so.

Sales of corrugated packaging totaled $10.8 billion for International Paper in 2021, by far its largest product category. Around half of the company's revenue comes from this type of packaging, broadly used across the e-commerce industry for its durability.

With FedEx warning about a slowdown, it's likely that International Paper will start feeling some pain as well. Analysts are expecting earnings per share of $4.52 this year, putting the price-to-earnings (P/E) ratio at just 7.6. That ratio is a bit deceptive; International Paper's earnings are almost certain to decline as the state of the economy worsens.

Still, such a low valuation gives investors a decent margin of safety. The beaten-down stock price has also caused the dividend yield to surge. Based on the most recent dividend payment, International Paper stock yields about 5.4%.

Owning International Paper stock is going to be a rough ride. But for long-term dividend investors willing to ride out the storm, it looks like a pretty good deal.

Hanesbrands

You'd think that a recession wouldn't prevent consumers from replacing worn-out underwear, but you would be wrong. So wrong, in fact, that the "underwear index" is often cited as a recession detection mechanism. When men's underwear sales start to tumble, the thinking goes, a recession is likely in the cards.

Hanesbrands is one of the biggest players in the underwear market, and it's already seeing its customers pull back. Innerwear sales were down 12% year over year in the second quarter, although there was a major ransomware attack that prevented the company from fulfilling orders. Still, Hanesbrands pointed to worse-than-expected sales trends at stores for part of the decline.

Even Hanesbrands activewear business, which is headlined by the Champion brand, suffered an 18% sales decline in Q2. The ransomware attack was part of the problem, but so was elevated retailer inventory levels and weak end-customer demand.

Hanesbrands stock has cratered this year, down more than 50% year to date. The dividend yield has shot up to 7.3%, and shares trade for just 7 times the average analyst estimate for full-year earnings. As with International Paper, you can expect Hanesbrands profits to come under further pressure as the economy weakens. But with such an intense level of pessimism, Hanesbrands looks like a great dividend stock for long-term investors.