When it comes to pinpointing the right moment to buy and sell, the legendary investor Warren Buffett perhaps has the best advice: "You want to be greedy when others are fearful and fearful when others are greedy."

The decisions of Buffett and his Berkshire Hathaway Inc. (BRK.A) - Get Report (BRK.B) - Get Reportare closely followed by investors, akin to the way the ancients scrutinized entrails for omens. And for good reason: Buffett's net worth now stands at $66.7 billion.

Fact is, one investor in a hundred may know the strategy Warren Buffett used to build his first million. Even fewer know the system can be followed by anyone. This strategy should (I'm quoting the great man himself here) earn you "50% a year in the stock market." There's no faster way to make your millions.

So, let's roll up our sleeves and delve into Buffett's sale and then surprising re-purchase this year of Phillips 66 (PSX) - Get Report .

In the second quarter of 2015, Buffett traded 19 million shares of his Phillips 66 stock for Phillips Specialty Products, a Phillips 66 segment that makes flow-enhancing chemicals. That seemed to be a big thumbs-down for the energy sector.

But here's the thing: in August 2015, Buffett bought right back into PSX. Berkshire Hathaway invested $4.48 billion to acquire a roughly 11% stake in Phillips 66. This reinvestment in the Houston-based refiner came directly on the heels his divestment in February, allowing him to buy an even bigger stake when the stock was at a low. What's this all mean for your portfolio?

Takeaway 1: Chemical stocks are attractive "recovery plays" now, especially in the context of low energy prices.

Master negotiator Buffett initially sold his Phillips 66 stake to leverage his purchase of the specialty chemicals division, from which he expects great returns. Chemical companies are cyclical in nature; they've been reaping bigger profits this year as economic recovery gains traction. Chemical companies also are enjoying higher margins, because the low price of oil and gas has reduced the cost of their inputs and raw materials.

One particularly attractive chemical company now is Dow Chemical, which crushed earnings estimates when it released its operating results this week. Small wonder that far-sighted Berkshire Hathaway invested $3 billion in 2009 into preferred shares of Dow Chemical.

Takeaway 2: Energy prices will bounce back.

Buffett clearly believes that select energy stocks such as Phillips 66, after going into free fall all year because of low energy prices, are now attractive bargains that are too good to pass up. It also suggests that Buffett expects energy prices to eventually rebound.

Saudi Arabia's price war and booming North American shale production continue to feed the globe's oil glut. Add flagging growth in China and emerging markets and you have a recipe for chronically low energy prices. But the fact is, modern industrial society will always need oil and the planet's population continues to grow. Energy prices won't stay low forever.

Takeaway 3: Only select stocks, such as low-cost refiners, are appealing energy sector buys. The energy giants, less so.

Buffett likes U.S.-based refiners such as Phillips 66 that can profit from their ready access to American-produced crude, which is cheaper than Brent North Sea Crude. Cost controls, combined with the crude price differential, are boosting PSX's margins.

Remember, though, that Buffett recently shed his stakes in ExxonMobil and ConocoPhillips, an indication that although he continues to bet on select energy stocks, he is bearish on the prospects of the major players in exploration and production (E&P). These energy giants must maintain huge capex budgets in the face of low energy prices.

And unlike PSX, big E&P companies such as ExxonMobil and ConocoPhillips generate the majority of their profits from upstream operations, making them far more vulnerable to depressed oil and gas prices.

With a trailing 12-month price-to-earnings (P/E) ratio of only 10.8, PSX is a compelling value compared to the P/E of 12.2 for its sector of oil and gas refining. PSX also sports a healthy dividend yield of 2.66, compared to the average dividend yield of 2.05% for the S&P 500.

When it comes to value investing and timing, you'd be wise to follow Buffett's lead.

John Persinos is editorial manager and investment analyst at Investing Daily. At the time of publication, the author held no positions in the stocks mentioned.