Warren Buffett is widely regarded as one of the greatest investors alive, and with good reason. He has delivered excellent returns in the past several decades as the CEO of Berkshire Hathaway (BRK.A -0.61%) (BRK.B -0.54%). That's why it pays to listen to his investing takes, especially when the market is experiencing a downturn.

What can Buffett's wisdom teach us about investing in an environment as tricky as the one we are currently in? Let's consider one famous quote from the Oracle of Omaha and how investors can apply it today. 

Person sitting and working at a desk.

Image source: Getty Images.

A warning against following the crowd 

Choosing a favorite from one of the many famous sayings attributed to Buffett is no easy task. But there is one that stands out for me. In a letter to Berkshire Hathaway's shareholders he penned in 1986, Buffett said his and his team's goal was to "be fearful when others are greedy and to be greedy only when others are fearful."

It is precisely when the stock market crashes that most investors are fearful, as evidenced by the fact that even quality companies often don't escape the sell-off. That also means it is the best time to be greedy if we follow Buffett's advice. Investors can do so by scooping up shares of excellent companies trading at a discount due to panic-selling. There are plenty of fantastic options, including one of Buffett's favorite stocks: tech giant Apple (AAPL 0.17%). Here's why the iPhone maker remains a buy.

Apple isn't done beating the market

Apple hasn't escaped the broader market sell-off this year, although it is performing better than the S&P 500, at least as of this writing. The company's business was harmed due to economic problems, including supply chain issues that affected its ability to meet the demand for some of its products. It's difficult to predict what will transpire next. The economy and the stock market could tank even more, affecting companies like Apple. But these are short-term issues investors should look beyond, especially considering there is still a strong case for Apple's long-term prospects.

One reason Apple's future still looks promising is its growing services segment. Once people are plugged into the tech giant's network of devices and offerings -- including Apple Pay, Apple TV, Apple Music, and iCloud -- it becomes hard to leave. Apple's customers rely on these services to collect pictures, contacts, music, and data; watch shows, and pay for products and services in thousands of stores. While it is possible to transfer much of this data, sticking with Apple is much easier and more convenient. In other words, the company's services segment benefits from high switching costs. 

This business unit generally records much juicier profits than Apple's products segment. What does that mean for the company's future? As the services unit grows in importance for Apple, so will the company's margins. Naturally, it isn't like Apple's products business is dead in the water. The company has proven its ability to innovate and stay on par with -- if not ahead of -- the competition.

Apple still generates billions from iPhone sales. Furthermore, it still benefits from a powerful brand name -- it was named the world's most valuable brand of 2021 by a U.K.-based brand valuation consulting company called Brand Finance. Economic issues may continue to harm the tech giant's business, and shares could fall even more. But whether or not they do, Apple looks like a solid pick. 

The market rewards patience 

Following Buffett's advice by being greedy when others are fearful pays off. History shows that the stock market always recovers following a downturn, and those with the presence of mind to invest shrewdly when equities are down tend to make a lot of money. Right now, Apple is a great candidate, considering the company's solid moat and its services segment, which is gaining importance. Those who get in on this tech stock today will be thanking themselves in five years.