When Samuel E. Dean Sr. founded his milk company at a processing facility in Illinois, milkmen still delivered pints to homes all over the United States and children dutifully drank three glasses a day.

That was 1925. Nearly a century later, milk is quickly going out of fashion and Dean Foods — which is now the largest milk company in the United States — has found itself unable to compete as plant-based and lactose-free dairy alternatives rise in popularity.

Saddled with debt and struggling to adjust to changing consumer habits, Dean Foods filed for bankruptcy protection on Tuesday, signaling another grim chapter in the recent struggles of the dairy industry. The company, whose portfolio of brands includes TruMoo and Lehigh Valley, said it was in talks to sell itself to Dairy Farmers of America, a marketing cooperative that sells milk from thousands of farms.

Across the food and beverage industry, the challenges facing Dean Foods are becoming increasingly familiar. In recent years, consumers have moved away from brands, and even entire categories of food, once seen as household staples . The decline of the milk industry has emerged as a particularly stark example of how these changing tastes are challenging major companies whose products once crowded store shelves.