We are in a big mess. There's panic in the air, and you know what? It's justified.

The market's fallen farther than it has at any time since the Great Depression. A huge investment bank has failed. So, effectively, has the largest insurer. Everyone wants to deleverage, except that there's nowhere to get capital to do so.

The average American recognizes the problems -- 2.6 million jobs lost in the space of four months will do that. Consumer spending recently fell for the sixth straight month. Of course, reduced consumer spending will only hurt the economy more.

The government is doing the right thing. They're protecting the financial system, helping banks to deleverage, and trying to jumpstart the economy through spending and tax cuts. The odds are that they will be successful. But, there is a small but significant chance that things fall apart.

Your portfolio should be prepared for both scenarios.

The conservative route ...
If you knew that a depression was coming, the solution would be relatively simple. Just buy long-term U.S. Treasuries -- one of the safest investments on the planet. From late 1929 to early 1932, during the Great Depression, prices fell by 27% in less than three years, or about 8.5% a year. If the same thing happened now, the nominal 3.6% yield 30-year bonds are offering would be equivalent to a 12.1% real return -- and you'd only pay tax on the 3.6%!

The problem with this strategy is that America might not collapse in a pile of dust.

Despite rumors to the contrary, we still has the strongest economy in the world. You could bet on America's utter failure. But if you're going to gamble, go to Las Vegas instead. The odds are way better there.

... is risky
Federal Reserve Chairman Benjamin Bernanke is an expert on the Great Depression, so he understands deflation. He spoke about it in a late 2002 speech saying that deflation isn't a problem because, "our banking system remains healthy and well-regulated, and firm and household balance sheets are for the most part in good shape."

Hmm, no, wait. That was the "waif-like naivete" part of the speech, not the important part. Let me see here ...

Deflation isn't a problem because "the U.S. government has a technology, called a printing press ... that allows it to produce as many U.S. dollars as it wishes at essentially no cost."

Though Bernanke was completely wrong about the banking system in 2002, he isn't wrong about how to manufacture inflation. Printing money will do it.

In this scenario, buying long-term U.S. Treasuries at 3.6% could prove to be a disaster. In the last 40 years, inflation has been above that level the majority of the time, and it could get far worse this time. Given the news headlines these days, locking in 3.6% returns for 30 years may seem conservative, but if Bernanke's warming up his printing press, it's foolhardy.

What do you need?
Instead of buying treasuries, take advantage of the fact that the stock market's dropped lower than Pamela Anderson's decolletage in Barb Wire. But don't just buy any stocks. To guard yourself against economic headwinds, focus on businesses that are truly needed.

Nobody needs a new pair of $120 Nikes, so skip Nike (NYSE:NKE). Nobody needs a new car -- that's why domestic car sales fell 41% year over year in February, and General Motors (NYSE:GM) and Chrysler are begging Congress for your money. Nobody needs to go on a cruise, so skip Carnival (NYSE:CCL). If the economy recovers, Nike and Carnival look cheap. But they'll struggle in a depression.

What we do need is food. Missing out on a cruise is sad, but starvation is decidedly worse. Yet, for seven of the last 10 years, the world has eaten more grain than has been produced, and grain stores as a percentage of use are significantly below long-term averages.

Food for thought
Now, most food companies aren't ideal picks because the product is commoditized. Beyond scale, it's hard to find sustainable competitive advantages or excellent growth prospects. However, food production requires fertilizer. And, though fertilizer is a commodity, it has far better economics than the food itself.

Take potash. Like other commodities, the price of potash spiked in the first half of 2008, primarily because supplies were tight. But unlike other commodities, it didn't fall in the second half of the year. It takes about seven years and over a billion dollars to open a new potash mine. In this environment, getting a billion dollars for a project that won't pay off for seven years is close to impossible. Supplies should stay tight.

So, you have a necessary commodity, limited supply, and increased demand. That combination means profits. PotashCorp (NYSE:POT), Mosaic (NYSE:MOS), and Agrium (NYSE:AGU) could be big winners.

Or, if you dislike commodities and prefer dominating competitive positions protected by patents, consider Monsanto (NYSE:MON). Monsanto sells pesticides like Roundup and seeds that are genetically modified to increase production and resist herbicides and pests. These patented products help to decrease costs for farmers.

The Foolish bottom line
Because these companies fill needs, they should be able to prosper even in troubled times. What's more, while their competitive positions make them great businesses, they're great investments because of their cheap prices.

Our Inside Value newsletter has found a number of stocks that should prosper in this environment -- companies fulfilling a need, with solid competitive positions, at cheap prices. You can read about them with a free trial.

Fool contributor Richard Gibbons isn't Foolhardy. He's more Foolflimsy. He owns shares of PotashCorp. The Fool's disclosure policy has been genetically modified for superior yields.