"Be fearful when others are greedy and greedy only when others are fearful."

- Warren Buffett

Among investors there are few quotes as well-known as Warren Buffett's advice to "be fearful when others are greedy and greedy when others are fearful."

Unfortunately, there are also few admonitions that are harder to follow.

Buffett eats his own cooking
Buffett first uttered this famous phrase (in writing, at least) in his 1986 letter to the shareholders of Berkshire Hathaway (BRK.A 0.58%) (BRK.B 0.38%), which, it's worth noting, was written in March 1987.

To students of financial history, that year protrudes like a sore thumb.

The postwar bull market was roaring at full steam. Corporate dealmakers, fueled by the proliferation of junk bonds, were gobbling up competitors and unrelated businesses alike. And the Baby Boomer generation was getting its first taste of stock market riches thanks to the growth of mutual funds.

As Buffett recounted:

As this is written, little fear is visible in Wall Street. Instead, euphoria prevails -- and why not? What could be more exhilarating than to participate in a bull market in which the rewards to owners of businesses become gloriously uncoupled from the plodding performances of the businesses themselves? Unfortunately, however, stocks can't outperform businesses indefinitely.

Seven months later, as if cued by Buffett, the market crashed.

On a single day in October 1987, the Dow Jones Industrial Average (^DJI 0.01%) dropped by 508 points, or 22.61%. Known as "Black Monday," it was and remains the largest single-day percentage decline in the index's history, exceeding even the worst trading session of the Great Crash of 1929.

In this light, Buffett's prescience and foresight was astounding. And even more impressive is the fact that it was the third time in his career that Buffett had foretold such a calamity.

Nearly 20 years earlier, he shuttered his investment partnership at the height of the 1960s, aptly referred to as the "Go-Go Years."

"I am not attuned to this market environment," he wrote to his partners in May 1969, "and I don't want to spoil a decent record by trying to play a game I don't understand just so I can go out a hero."

The market plummeted soon thereafter. As Roger Lowenstein observed in Buffett: The Making of an American Capitalist, "By May 1970, a portfolio of every share on the stock exchange was down by half from the start of 1969."

And Buffett did the same thing in the mid-1970s, though this time he exploited the downside.

Following the cataclysmic decline of 1973 and 1974, Buffett increased Berkshire's stake in Blue Chip Stamps, the parent company of See's Candy Shops, among others, and in 1975 he acquired K&W Products, a manufacturer of specialty automotive chemicals for use in automobile maintenance.

As he noted in his 1975 letter to shareholders, "stock fluctuations are of little importance to us -- except as they may provide buying opportunities."

The road to underperformance is paved with good intentions
While this narrative makes market timing sound easy, nothing could be further from the truth.

As investors, we are our own worst enemies. Thanks to evolution, we're programmed to flee in the face of fear and fawn in the presence of greed.

The net result, as the author Carl Richards has aptly summed up in the diagram below, is that the vast majority of us, despite our best intentions, end up buying high and selling low.

"It's not that we're dumb," explains Richards in The Behavior Gap. "We're wired to avoid pain and pursue pleasure and security. It feels right to sell when everyone around us is scared and buy when everyone feels great."

With this in mind, it should come as no surprise that most investors -- professionals and individuals alike -- dramatically underperform the broader market.

According to an annual study conducted by DALBAR, a Boston-based research and analytics firm, the average individual investor in an equity fund has underperformed the S&P 500 (^GSPC 0.70%) by a factor of two since the early 1990s.

Between 1992 and 2012, the S&P 500 returned roughly 8% on an annual basis. Meanwhile, the individual investor notched annual gains of just over 4%.

The point here is Buffett's advice to be "fearful when others are greedy and greedy only when others are fearful" is easier said than done.

By the same token, however, it's also worth noting that the benefits to following it, if you have the temperamental fortitude to do so, can indeed be extraordinary.