Desperation can lead to greater success.

NEW YORK – One of the most painful moments small-business owners face is when they realize: It's not working.

It could be a product that's not succeeding, business that's taken away by a competitor, or changes in the economy that threaten a company's survival.

When something has gone awry and sales are taking a hit, company owners have to make big changes to turn things around — and they usually can't afford to waste time. Large companies often have enough revenue coming in from a variety of products and services that they can weather a problem in one area of their business. Smaller companies typically don't have that cushion.

Reinventing a company, large or small, is not an easy task and it can't be done overnight, but here are how two business owners have been able to pull it off.

Socked by global trade, company gets inspired

Cabot Hosiery Mills had great success its first 20 years, making what are called private label socks for retailing chains. It only made socks that carried the names of the stores that sold them such as J.C. Penney and Gap.

But in 2000, sales began falling as stores began buying cheaper socks from Chinese vendors, says Ric Cabot, co-owner and son of the company's founder.

By 2003, sales were down by more than half. Cabot was forced to cut his staff of 70 down to 30.

“We needed to create a product that would basically save us,” he says.

Cabot didn't have to look far to find a market niche his company could fill. An avid hiker who is also active in several sports, he had a hard time finding high-quality socks for those activities that were comfortable and durable.

So Cabot combined survival, know-how and personal interest and created Darn Tough Vermont, a line of socks for outdoor activities and sports.

There were some things about socks that he didn't know, like how to make ones that appeal to style-conscious hikers, skiers and runners. So he had to hire someone who did.

It took about two years for the socks to hit the market. Now they can be found in many stores that sell outdoor gear. The brand has been successful enough that the company has grown to 150 workers and annual sales have quadrupled from the low they hit in 2003. Cabot still has a small private-label operation.

Cabot says he has learned a lot from the experience.

“Almost going out of business, if you leverage it properly, is one of the best experiences to emerge from because you see the mistakes, the warning signs a lot sooner,” he says. “You try to take a longer-term view of the business— not just what I need to do today, but what will ensure the best tomorrow?”

Drink company fizzles, then gets refocused

Arnulfo Ventura and his business partner, Jose Domene, decided while getting their MBAs at Stanford University to start selling aguas frescas, beverages made from plants like tamarind and hibiscus, that are popular in Mexico. The partners called the drink Bonadea and ordered the first batch of 3,000 bottles from a manufacturer by the time they graduated in June 2008. They found several customers: Six delis and natural food stores in the Palo Alto, Calif., area.

Over the next year, the duo attracted enough money from investors to increase production, working their way up to a run of 15,000 bottles. They got a distribution company in the Los Angeles area and Bonadea was in hundreds of convenience and small grocery stores. Things seemed to be going well.

But Bonadea, priced between $2.49 and $2.69 a bottle, didn't sell as well as hoped. Sales were up by hundreds of percentage points from the first batch, but Ventura expected an increase in the thousands by then.

“We just weren't getting serious attention. The brand wasn't moving off the shelf,” he says. “I wasn't sure if it was the price point or the marketing.”

In January 2010, Ventura and Domene showed Bonadea to focus groups.

Based on the feedback, the partners realized they had to change the way the beverage was packaged and marketed. One problem was its name, which had no real meaning. People didn't connect with it. And the 16-ounce bottle looked too much like the ones that contain Snapple, one of the top-selling iced tea and juice drink brands in the country.

Over the next nine months, they considered many names and label designs and eventually came up a new name, Coba, a Mayan city on the Yucatan peninsula and decorated the labels with images of flowers and fruit. In March 2011, they took Coba to a trade show in Anaheim, Calif. On the show's last day the organizers surprised the partners by announcing that they had picked Coba as the best product in the show. Coba also caught the interest of retailers.

The partners began producing their new beverages — but soon came another worry: Nestle, the world's largest food and beverage maker, was introducing its own aguas frescas. And there was competition from natural soda maker Hansen. Ventura hurried to Whole Foods' headquarters in Austin, Texas with a bag filled with Coba on ice. He met with an executive just hours after Hansen's representatives visited, made his pitch and showed his product. The company decided to carry the beverage in some locations.