Bed Bath & Beyond came out of the 2008 downturn a winner. Competitors like Sharper Image and Linens ‘n Things filed for bankruptcy, but Bed Bath & Beyond actually expanded its business by acquiring other retailers. Its home-goods emporiums full of towels and kitchen aids — all available at a reduced price with that big blue coupon — were beacons that kept shoppers coming back.

Now, as the U.S. economy experiences another period of uncertainty, Bed Bath & Beyond is no longer on top, the result of an increasingly unwieldy corporate structure and its failure to fully reckon with the ascendance of online shopping.

On Sunday, the 52-year-old retailer said it was filing for bankruptcy protection in United States Bankruptcy Court for the District of New Jersey and would be conducting a “limited” process to sell some or all of its business. The company’s 360 Bed Bath & Beyond stores and 120 Buy Buy Baby stores and websites will remain open.

To help fund its operations in bankruptcy, Bed Bath & Beyond has raised $240 million from the investment firm Sixth Street Specialty Lending.

The company’s decline offers a glimpse into the forces that are shaping the post-pandemic retail landscape. For companies like Bed Bath & Beyond, whose financial problems were masked as consumers rushed to spend the stimulus money in their bank accounts, the economic concerns of the past few months are exposing those weaknesses. It will become even more crucial for retailers to adapt as shoppers cut back on discretionary spending.

“We are going to see the Darwinism of retail,” said Michael Lasser, a retail analyst at UBS who has covered Bed Bath & Beyond for 16 years. “2023 will be characterized, in part, by seeing that play out after this period of what would have been a pause in the Darwinism.”

The past several years have been tumultuous for retailers. In 2020, early on in the pandemic, J.C. Penney, Neiman Marcus and J. Crew all filed for bankruptcy. But in the past two years, retailers have benefited from U.S. consumers’ willingness to spend. Now, in an environment where shoppers are being more discerning about what they buy and where they purchase it, more companies will be at risk.

The retail landscape looked much different when Bed Bath & Beyond was started in 1971 as a way to compete with the home goods section of department stores. The company’s founders, Warren Eisenberg and Leonard Feinstein, opened the chain’s first stores in New York and New Jersey. The venture was originally called Bed N’ Bath, a nod to their narrow line of merchandise.

Compared with a store like Macy’s, this upstart company promised a larger selection of bedsheets, towels, shower curtains and other home necessities. As their merchandise assortment and store base expanded, the retailer was renamed Bed Bath & Beyond in 1987. It went public in 1992.

The retailer embraced innovation, former executives and employees said. Instead of TV ads, Bed Bath & Beyond relied on word-of-mouth advertising and the large coupons it had delivered to millions of Americans mailboxes. Countless shoppers would keep those 20 percent off cards in their cars or junk drawers, a reminder to head to Bed Bath & Beyond if they were considering, say, a new toaster.

Bed Bath & Beyond also had a decentralized warehouse strategy that allowed store managers to be more flexible in ordering the merchandise that would appeal most to shoppers at their location.

It was also early to use integrated digital technology within its stores. Instructional videos would play in front of displays for items like SodaStreams or juicers, so shoppers would get a sense of how they could be used at home. It started its website in 1999.

In 2000, Bed Bath & Beyond had 311 stores. A decade later, it had 1,100. From 2002 until 2012, the company acquired Harmon Stores, Christmas Tree Shops, Buy Buy Baby and Cost Plus World Market. The brands helped diversify the company from a retail perspective, but the moves also diverted management’s focus away from other crucial investments, like its e-commerce business, according to Richard McMahon, who held various executive titles including chief strategy officer during his 17 years with the company before leaving in 2015.

“There wasn’t as much focus put on the organic business — Bed Bath & Beyond — and evolving that business to consumer behavior,” Mr. McMahon said. “The internet started to become real and consumer behavior was changing through that process.”

But competitors like Amazon, Target and Walmart were investing in making the online experience better for shoppers, and Bed Bath & Beyond saw its market share dip. Google searches also worked against it because the 20 percent discounts were not factored in online, leading shoppers to believe that retailers like Amazon offered better deals.

“Looking back on it, we would have had an opportunity where we could have been investing better in evolving the core business than some of these other acquisitions,” Mr. McMahon said.

In 2014, Bed Bath & Beyond got into the debt market for the first time by selling $1.5 billion in bonds to buy back stock. Many retailers avoid taking on debt, well aware of the industry volatility that can quickly turn a reasonable debt load into a serious financial burden. Mr. Lasser, the UBS analyst, described the move as a “seminal event” and wondered if it was an attempt to raise the company’s stock price to fend off activist investors.

If that was the intent, it wasn’t a long-term solution. In 2019, a trio of activist investors — Legion Partners, Macellum Advisors and Ancora Advisors — won a fight with the retailer that gave them the choice of four new board members and, eventually, a chief executive they supported: Mark Tritton of Target, the first C.E.O. to come from outside the company.

Much of the workplace culture at Bed Bath & Beyond soon changed. There were layoffs. Store managers had less say over which items would be stocked in their stores. Mr. Tritton, who left the company last year, declined to comment on his tenure.

When the pandemic came, Bed Bath & Beyond joined other retailers in dealing with supply chain issues. But the company’s decentralized system complicated things further and its e-commerce technology was less advanced than many of its biggest competitors.

Revenue in 2020 fell to $2.6 billion, a 16 percent drop from 2019. As its business crumbled, what had once been a manageable debt load quickly became unsustainable.

As the company looked for places to cut costs, it started to undo the things that people loved about Bed Bath & Beyond. In 2020, the retailer said it would scale back on mailing out its trademark coupons. It moved away from national, well-known brands in favor of making its own batch of private label brands, which usually have better margins for retailers. In an attempt to make stores feel more open, it removed items and tore down its 14-foot-tall tower of towels.

“Bed Bath & Beyond had almost become a manual for how to adult,” said Chris Dancy, 54, a once-loyal Bed Bath & Beyond shopper who was introduced to the brand in his early 20s.

He used to go into their stores weekly, but after the coupon was scaled back, so too were his visits.

“The allure of having the Willy Wonka golden ticket — or blue ticket — was gone” he said.

In August, the company announced an aggressive restructuring plan, saying that it would close 150 stores and lay off more workers. Mr. Tritton had left the company in late June after another disappointing quarter of sales. Ms. Gove, the interim chief executive, said she was personally calling vendors to reassure them that Bed Bath & Beyond would pay them what it owed.

Just a few days after the restructuring announcement, the retailer was thrown into emotional tumult when its chief financial officer, Gustavo Arnal, died. Mr. Arnal’s death was ruled a suicide, according to the New York City Medical Examiner’s Office.

Bed Bath & Beyond’s suppliers started to get spooked and began demanding payment upfront. That led to in-stock levels around 70 percent during the past holiday season, according to Ms. Gove, who became permanent chief executive in October.

In early January, Bed Bath & Beyond warned investors that bankruptcy was a possible option. On Jan. 26, it said it had defaulted on its debt payments.

It started laying off workers and closing stores. It quickly liquidated its Harmon beauty and health chain, which it had owned since 2002.

In early February, it sidestepped bankruptcy after coming up with a plan to use a public stock offering to raise more than $1 billion. The plan, backed by Hudson Bay Capital Management, was only good so long as Bed Bath & Beyond’s stock stayed above a $1 dollar a share. Earlier this month, Bed Bath & Beyond canceled that deal after its terms were breached. Its stock closed at 29 cents a share on Friday.

All the while, sales at the retailer continued to fall, starving the company of the cash — and confidence — necessary to keep suppliers shipping to its stores.

“It’s a death spiral,” Neil Saunders, the managing director at GlobalData’s retail division, said. “If you can’t get the stock, you can’t make the sales. If you can’t make the sales, your credit deteriorates. If your credit deteriorates, people are less willing to supply you. That cycle seems impossible to break.”