We all invest for the same reason: to make money. And in order to make money investing, we need to know two key things: when to buy and when to sell.

If you can buy something for $1 and turn around and sell it for $2, then you've made money. If, on the other hand, you buy for a buck and can't find someone willing to take it off your hands for more than $0.50, you've lost money. Clearly, to make money at investing, the goal is to buy low and sell high. More than half a century ago, Benjamin Graham, the pioneer of value investing, came up with a simple way to do just that -- a concept known as the "margin of safety." By deploying this technique, investors greatly decrease the chance that they'll lose their hats and increase the likelihood that they'll trounce other investors.

Following in Graham's footsteps, Bill Miller, who runs Legg Mason Value Trust (LMVTX), has beaten the market for 15 consecutive years -- something that is practically unheard of in the mutual fund industry. And Miller's long-run performance pales in comparison to that of Warren Buffett, a former pupil of Graham's and current head of Berkshire Hathaway. What's more, Graham's margin of safety is something we put to good use here at the Motley Fool Inside Value newsletter service.

Know a company's true worth
The key to success is a clear understanding of a company's true worth. With that knowledge in hand, buying low and selling high becomes a simple matter of waiting, buying a stock only when it falls below the company's true worth by a tempting margin. Once you own it, you need to keep tracking the company's value. When the stock rises to an uncomfortably high premium to its true worth, sell it. The central lesson: All buying and selling decisions should be guided by comparing a company's stock price to its true worth, not by some vague notion of what the hot stock of the moment is.

My friend and colleague Philip Durell follows that philosophy as chief analyst at Inside Value. His selections as a whole are beating the market's return since the newsletter's inception in 2004. His record is added proof that using a margin of safety truly does work.

Philip has beaten the market by not giving into the temptation to buy "the next big thing." As sexy as the marketing pitch may be, the next big thing often falls flat on its face. After all, look what happened to Baidu.com (NASDAQ:BIDU) since its highly publicized IPO. The company's stock has fallen since going public, despite being initially proclaimed as China's answer to Google.

Closer to home, consider the all-American struggle of networking pioneer JDSU (NASDAQ:JDSU). At the forefront of the dot-com boom, this business' fiber-optic services were going to launch a revolution of high-speed communications. While high-speed networking has certainly changed the world, the story and the stock got too far ahead of the market for the products. As a result, investors who bought in near the peak of the hype are still down more than 90%. These are painful lessons, indeed, about investing in the next big thing.

Instead, Philip has relied on companies with proven strong businesses and competitive moats, such as rent-to-own giant Rent-A-Center (NASDAQ:RCII). Though it's larger and more profitable than its primary rivals, Rent-Way (NYSE:RWY) and Aaron Rents (NYSE:RNT), Rent-A-Center nonetheless stumbled recently. Its newer, more customer-friendly stores have cannibalized sales at its older units. That cannibalization has depressed same-store sales, taking the company's share price down with it.

That stumble provided just the opportunity Philip needed to suggest that subscribers buy low. As would be expected, Rent-A-Center is not sitting still through this crisis. Its recent plan to close its underperforming outlets will go a long way toward improving operating efficiency. Already, since being selected for Inside Value this past October, the company's shares have rocketed some 52.96% -- far exceeding the market's gain of 8.57%.

Buying low with the margin of safety
Every company has what Graham calls an "intrinsic value," a measure of what a company is really worth. Finding that value is part art and part analysis. One of the most powerful tools in a value investor's toolkit is a discounted cash flow calculator, into which you put your estimate of how much cash the company will generate in the ensuing years. The calculator then tells you how much the company is worth today. Inside Value has just such a calculator available to subscribers. If you're already a subscriber, click here to access it. If not, click here to take a free 30-day trial to the newsletter and play with the calculator to your heart's content.

Once you've figured out what the company is worth, you can use that information to determine whether or not it has enough of Graham's margin of safety to be worth buying. Imagine buying the forerunner to oil giant ExxonMobil (NYSE:XOM) at the start of 1995. At a split-adjusted $15.19 per stub, you would have been buying shares in a business priced as though the multidecade low oil prices would be a permanent fixture in the world economy. Yet throughout its history, oil has been a cyclical commodity, prone to occasional price spikes. Eleven years later, on the back of oil's recent climb, the company traded hands at $66.47, up a staggering 338% from that start date.

Selling high with the margin of safety
Logically, if a company trading below its intrinsic value is worth buying, then a company trading at or above its intrinsic value just might be a candidate for selling. After more than doubling for subscribers between October 2004 and November 2005, Philip recommended just such a sell for former Inside Value selection Omnicare (NYSE:OCR). Its shares had simply run past Philip's objective analysis of their true worth. Just as discount prices don't last forever, shares don't continue to trade far above their fair values forever. In fact, at its recent price of $44.91, it has fallen more than 24% from Philip's sell price of $59.61.

Following the formula
Once you've figured out what a company is really worth, its margin of safety will tell you when it's time to buy and when it's time to sell. The lower a company's price with respect to that intrinsic value, the stronger the margin of safety, and the better the chance that buying that company will lead to a profitable investment. The higher a company's price with respect to that intrinsic value, the more that margin of safety has been reversed, and the better the chance that it's time to sell your position and take the extra profits from your bargain-hunting trip.

Like the idea of finally knowing how to buy low and sell high? Want more value investing tips and techniques? Click here for a free 30-day trial to Inside Value, The Motley Fool's home of the margin of safety.

This article was originally published on July 13, 2005. It has been updated.

At the time of publication, Fool contributor and Inside Value team memberChuck Salettaowned shares of Omnicare, but he wishes he had sold when Philip made that suggestion. The Fool has adisclosure policy.