There's been a bloodbath in the markets lately. Investors, banks, and investment banks are all trying to stay afloat in a sea of red ink.

Forgetting about the happier, more bullish times is easy to do when circumstances turn against us, but we must do our best to stay calm. To keep your cool as a rational investor, here are a few wise words to remember when dealing with the stock market's ups and downs.

It happens, even to the best investors
You can easily feel isolated when you're handed huge losses, but even the best investors falter.

Charlie Munger, now vice chairman of Berkshire Hathaway (NYSE: BRK-A) (NYSE: BRK-B), ran an investment partnership called Wheeler, Munger & Co. back in the '60s and '70s. Munger's partnership performed admirably and trounced the indexes. However, in the brutal bear markets of 1973 and 1974, it recorded back-to-back annual losses of 31.9% and 31.5%, compared with losses of 13.1% and 23.1% for the Dow.

Wheeler, Munger & Co. persevered. It returned 73.2% in 1975, and Munger went on to become a billionaire with Berkshire Hathaway. I'm skipping the interim details, but the moral of the story is: Just because you're sitting on a big loss doesn't make you a horrible investor.

Some losses are temporary
An article in the latest issue of Barron's noted that private-equity firm Warburg Pincus remains committed to its capital infusion of $500 million into besieged bond insurer MBIA (NYSE: MBI), even though its cost basis will be about $31 per share, compared with the current trading price of around $11.43 per share.

In the article, a Warburg spokesperson pointed out that the firm's early '90s investment in Mellon Bank -- now part of the Bank of New York Mellon (NYSE: BK) -- also rang up a sharp loss before it turned into a huge gain.

Time will tell whether Warburg's patience will be rewarded. It's worth noting that successful firms and investors draw a sharp distinction between temporary and permanent losses of capital.

Bill Ackman, a prominent bear on the other side of MBIA trade, feels the same way about differentiating between temporary and permanent losses. His large stake in Target (NYSE: TGT) plummeted as investors dumped recession-prone stocks.

However, Ackman pegs Target's worth, given its valuable underlying real estate, credit card receivables, and strong cash flows, at $120 per share, and on he said that Target "is a case actually where I think a mark-to-market loss is not a real loss." In other words, as long as an investment thesis remains intact, Ackman doesn't consider a stock that's down because of short-term market movements is a permanent loss.

Look for buying opportunities
If the stock market will make us suffer huge losses, the least we can do is take advantage of the great prices. If you've ever wondered how Warren Buffett does what he does, one crucial factor is when he does it.

During the banking crisis of the early '90s, when everyone else was running for the exits, investors such as Buffett and Prince Alwaleed made fortunes buying huge stakes in ailing banks, including Wells Fargo (NYSE: WFC) and Citigroup (NYSE: C). When everyone else was dumping stock, the smart guys were looking to buy.

Foolish thoughts
Keeping your composure isn't easy when the stock market plummets. However, Fools need to stay rational and composed to make the most of a temporarily bad situation.

Related Foolishness:

Berkshire Hathaway is an Inside Value and Stock Advisor pick. Try any one of our investing services free for 30 days.

Fool contributor Emil Lee is an analyst and a disciple of value investing. He doesn't own shares in any of the companies mentioned above. Emil appreciates receiving your comments, concerns, and complaints. The Motley Fool owns shares of Berkshire Hathaway. The Fool has a very cool disclosure policy.