This is a good time to be shopping for retailing stocks. Worries over sluggish consumer spending trends have pushed valuations down for most of the sector even though cyclical downturns are a normal, and temporary, part of the economic cycle. It makes sense, then, to consider purchasing the best of these businesses when they are trading for a discount.

Some stocks are down for better reasons than others, though, so you should focus your investing dollars on retailers that boast more attractive long-term outlooks. At the same time, you should try to avoid those companies that are losing market share or have weak profit outlooks. Let's look at two retailers that might be worth buying right now and one that should be avoided.

Buy these 2 stocks

Costco Wholesale (COST 1.01%) and Home Depot (HD 0.94%) stocks are definitely worth a closer look.

Let's start with Costco, which recently announced solid fiscal 2023 Q4 customer engagement metrics that included rising traffic and sales. The warehouse club specialist is clearly delivering plenty of value on the products it offers for sale to its club members. You can tell that by looking at its membership renewal rate. Members are renewing at an over 91% rate today, a record for this business.

The biggest concern about Costco is that the stock is not cheap. Shares trade for 39 times earnings, a big premium compared to its main rival Walmart, whose P/E ratio is 31. Still, investors get a lot of value from that premium, including steady sales and earnings growth through a wide range of selling environments.

As for Home Depot, the short-term outlook for this home improvement specialist isn't nearly as stable due to its focus on the more consumer-discretionary side of the industry. Comparable store sales are on track to fall by between 2% and 5% this year as home improvement spending slows further.

Yet Home Depot still manages to produce an ample profit margin of over 14% of sales, keeping it well ahead of rival Lowe's. Management for both home improvement companies remains highly optimistic about the industry's potential in the years ahead as more people enter the housing market and the country's aging housing stock requires additional investment.

While investors wait for that impending rebound, they can collect a robust dividend, too. Home Depot's dividend yields 3% today, partly thanks to the stock's relatively weak performance in 2023.

Avoid this stock

When it comes to retailers to avoid at the moment, investors might want to pass on the big discount found with Target (TGT 0.18%) stock. Sure, you can own this business for a relative steal of 15 times earnings and 0.5 times sales. Walmart costs 0.7 times sales and Costco is priced at 1 times revenue, for context.

But Target faces bigger challenges than its peers right now. Customer traffic declined 5% last quarter, representing a worsening of that key growth metric compared to earlier in 2023. Retailers with higher proportions of consumer staples like groceries in their product mix, like Walmart and Costco, have seen rising traffic this year. Target is also approaching the holiday shopping season with light inventory levels, which is good for short-term profitability but could expose the company to weak sales in this crucial period.

The biggest concern is around profit margin. Target is hoping to get operating profit back up toward 6% of sales, or close to its pre-pandemic rate. The stock's drop since early 2022 can largely be explained by the collapse of that key metric down to 3% of sales from 8% of sales during the pandemic growth surge. The good news is Target remains profitable and has a long track record of boosting its dividend payment. But the stock is only worth watching for concrete signs of improving operating trends at this point.