It’s amazing the difference just a few weeks makes.

Back in January, the TSX Composite dipped below 12,000 for the first time since 2013. Oil was below $30 per barrel. Canada’s banks were seemingly about to cut their dividends because of exposure to risky loans. And a weak Canadian dollar was threatening to wreak havoc on any company that imported a meaningful amount of anything from China.

Two months later, the market has seemingly forgot about all of that, even though these risks haven’t really gone away. Oil has recovered to $40 per barrel, but that still isn’t high enough for many Canadian energy producers to avoid bankruptcy. Loans to oil-rich areas are still something that keeps bank execs up at night, never mind Canada’s housing bubble. And while our currency has recovered, it’s still not enough for many importers.

This isn’t to say we’re heading for another 25% decline, because I don’t think there’s any reason to be that bearish. But I do think investors have to worry about markets turning south. It’s only prudent after we’ve seen a big move off the bottom.

Here’s how investors can prepare themselves today for the next time stocks decline meaningfully.

Buy bonds

There’s one simple reason bonds don’t get any love: they’re boring.

But they’re also immensely valuable when markets go down. Let’s look at Canada’s largest bond ETF, the iShares DEX Universe Bond Index Fund (TSX:XBB) as an example.

During that 18-month period where the TSX Composite lost 25% of its value, shares of this bond ETF were actually up. Capital appreciation wasn’t much, only coming in at approximately 3% over the period. But add in dividends of some 2.8% per year and the total return was over 7%.

Compared to the pain felt by equity investors, that’s a terrific return.

Say an investor had a portfolio that was 60% equities and 40% bonds. This portfolio would have only lost 12.2% during that tough stretch for the TSX Composite. Sure, losing 12% isn’t an ideal outcome, but it still beats losing 25%.

Sit on some cash

Many investors are fully invested all the time.

There’s certainly a case to be made for positioning your portfolio that way. If markets tend to go up, then sitting on cash is a significant opportunity cost. And for many investors, finding interesting stocks isn’t difficult.

For the most part, I agree. Waiting for the next crash is a sucker’s play. We have no idea when the crash is coming. And when it does, every external stimuli is telling an investor to stay away from the market.

But at the same time, I think investors should have a little cash available to take advantage of market crashes. Most investors accomplish this naturally by making regular contributions to retirement accounts.

This is when having a healthy fixed-income component to a portfolio really comes in handy. Investors can sell their bonds when times are bad–usually for a gain–and use the proceeds to buy cheap stocks. When times are better and stocks are no longer cheap, new money can put towards bonds.

Buy great stocks

Doing nothing during a bear market is exceptionally difficult, especially as pessimism really starts to set in. The instinct is to sell and protect capital.

This is why investors need to select great stocks to begin with. It’s much easier to have confidence in a company you think is truly wonderful than one you bought looking for a quick profit.

A company such as Loblaw Companies Limited (TSX:L) is a great choice. Not only do shares of Canada’s largest grocer have a history of outperforming during times of overall market weakness–thanks to the defensive nature of the industry–but there are many other compelling reasons to add the company to your portfolio over the long haul.

Loblaw has a terrific management team, trades at a reasonable valuation, and should benefit greatly from an aging population after buying Shoppers Drug Mart and its millions of pharmacy clients.

Three more buy-and-hold-forever stocks!

Loblaw isn't the only stock investors should buy if they're worried about the next bear market.

These three top stocks will allow any investor to sleep well at night. Check out our special FREE report: "3 Dividend Stocks to Buy and Hold Forever". Click here now to get the full story!

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Nelson Smith has no position in any stocks mentioned.