Retail has faced some unique pressures over the past few years. The rise of digital and push toward omnichannel selling has essentially separated retailers into three classes.

There's a group of clear winners, including Walmart (WMT -0.10%), Target (TGT -1.55%), Costco (COST -0.15%)Amazon (AMZN -0.34%), and a few others. Then there's a middle class including Macy's (M -0.49%) and Kohl's (KSS -4.37%) that might have been sensible investments before the coronavirus pandemic but are less sure right now. Lastly, of course, there are the losers, companies including J.C. Penney (JCPN.Q) and Sears (SHLDQ) that faced long odds before this crisis and now face probably insurmountable hurdles.

The exterior of a Walmart.

Walmart has been thriving during the pandemic. Image source: Walmart.

Should I buy retail stocks?

If you have money that makes sense to invest -- meaning that you can cover your bills, have an emergency fund, and have cash that you don't need to meet near-term needs -- retail may be a smart place to put your money. Many of the top players in the space are trading well below their 52-week highs.

Some of these brands, including the aforementioned Walmart, Target, Costco, and Amazon, may actually see sales rise due to the role they are playing in keeping people supplied during the pandemic. That may also be true for Best Buy (BBY 0.57%), a surprise winner during the pandemic as people struggle to get home offices set up and to meet their entertainment needs.

All of the companies worth investing in now were retailers that were doing well before the crisis hit. Some strong retail brands that are closed, like TJX Companies (TJX -1.13%), which owns Marshall's, HomeGoods, and TJ Maxx, may also be a smart investment.

In the case of TJX, the company will take a major hit to its sales while its stores remain closed. It should, however, recover quickly once stores reopen, since it sells discount merchandise which may be in higher demand as consumers will likely have less money to spend. This particular retail chain may also benefit from being able to get access to merchandise from orders canceled by higher-end retailers.

Coronavirus has simply made what was already true more evident. All of the top-tier retailers mentioned above have invested heavily in the supply chain and getting consumers what they want and how they want it. That looks a little different for Amazon than for TJX, which largely sells in-store (though it has ramped up its digital efforts), but it's all about meeting customer demands.

Invest (if you can) but be patient

If you believed in Kohl's or Macy's before the coronavirus pandemic, recognize that both companies now face a more difficult path ahead. That does not mean that either will fail, but the current situation has shortened the runway and likely extended the turnaround timetable for both companies.

For the best-in-class retailers on the list above, a stock recovery will almost certainly happen, but it's important to remember that there's no guarantee it will happen quickly. A prolonged recession could curtail sales and force profit margins down.

Nobody knows what the recovery for this situation will look like because the modern world has never faced a situation like this. That means that if you invest, be prepared for a bumpy road and be patient. The recovery, even for top-tier retailers, may take a while (think years, not months).