Every year in New York City real estate has its challenges. But never have residential brokers and their agents been barred by law from showing apartments. All bets are off in a global pandemic, though, and banning agents from the homes they rent and sell is exactly what Gov. Andrew Cuomo did as coronavirus infections blazed through the city last spring.

Residential agents were required to stay home for three months before the state restrictions on in-person showings were finally lifted in late June. The effect was profound. Manhattan’s home sales market experienced a record drop in the number of deals that closed during the second quarter of the year, which coincided with most of the three-month lockdown. It was the sharpest decline in 30 years, and the median sales price dropped nearly 18 percent. Home sales in the final quarter of 2020 were only over half of what they were a year earlier.

With rentals, the number of Manhattan apartments on the market hit an all-time high in the third quarter, at nearly 16,000. Manhattan’s vacancy rate topped 6 percent in October, with the rate in the borough’s tony Downtown neighborhoods nearing 8 percent as New Yorkers of means fled the city. Listing inventory ended the year 172 percent higher than the year before.

Though rental leasing has picked up in recent months, in December there were still close to 14,000 empty apartments in

Manhattan alone. The city’s brokerage industry is feeling the crunch. Nearly 4,000 agents terminated their real estate licenses last year, equivalent to a loss of 9 percent of the workforce.

At the end of the third quarter, Elliman, the only brokerage in the city that publicly discloses its quarterly financials, reported a net loss of $62.2 million year to- date, a huge drop from the $6.6 million in net income it had during the same period in 2019.

The brokerage community isn’t alone. There’s plenty of pain to go around, and developers and landlords are feeling their fair share as lenders review slipping sales targets and falling rent rolls with a careful eye.

With an eviction moratorium in place, landlords are barred from booting any tenant who’s unable or unwilling to pay rent. Without financial aid, many smaller mom-and-pop landlords find themselves trapped between the law on one side and their mortgage lenders on another.

For high-end condo developers, the choice is either to pivot their business plan by selling off bulk units to a well-capitalized buyer who will then either convert them into rentals or wait until the market improves to sell them, or else turn the whole building into rentals.

The most public reckoning so far has been Ziel Feldman’s battle with lenders across his portfolio as his firm HFZ’s investors and lenders have sued it for more than $300 million. To make matters worse, Feldman and his wife, Helene, are personally on the hook for many of the loans, putting them at risk of losing it all.

Out West, Los Angeles did set a record for the most expensive single-family home buy in California history when Jeff Bezos paid media mogul David Geffen $165 million for a Beverly Hills mansion. But in L.A. County, as with other metro areas, the center of gravity shifted to the suburbs last year.

In the Hamptons, the top 10 home sales last year totaled 48 percent more than in 2019, and most of the Chicago area’s priciest sales were in tony towns surrounding the city.

But in South Florida, where luxury homes typically feature the wide-open spaces that have commanded a premium in the pandemic, median home prices rose sharply in almost every submarket.

Here’s a close look at the residential sector in New York City and other key markets that we cover — Los Angeles, Chicago and South Florida — during one of the industry’s most difficult years in modern times.