Stay the Course
If you held onto your investments during a market collapse, you most likely need to continue holding onto them. If you made your investments based on sound company financials across different companies and risk categories, then the investments are probably good and have a better chance of becoming profitable again than investments made on gut feelings or exaggerated claims by a broker. It may take some time, but the markets will recover, even if individual companies don't. Your losses aren't locked in until you sell your investments, so if you're still 10 years away from needing to tap into those investments, wait for the bear market to turn around.
Balance Your Investments
Bonds aren't as volatile as stocks in their price shifts. They tend not to drop as much in a bear market as stocks do and even occasionally rise during a recession. However, on the flip side, they tend not to rise as quickly as stocks. The rule of thumb when saving for retirement is that your age should be the percentage of your investment in bonds. That way, as you age, your portfolio becomes less volatile as the time grows closer for you to need the funds. Balancing your funds also includes diversifying them over a number of businesses so that you don't lock your future financial health to that of a single company.
Funds that work opposite the market--increase in value as markets decline--are called inverse funds. Many of them are tied directly to a particular index, such as the S&P 500, Dow Jones Industrial Average or Russell 2000. If you believe a recession if coming, invest in inverse funds. As the market falls, your inverse funds increase. When you see the recession ending, sell the inverse funds and invest in regular funds.
In and Out
If you feel a recession is coming, move your money into safer investments, such as money market funds. The market may continue to rise, but if you had good reason to believe the market would fall, wait it out. If it turns out you were wrong, you can get back in the market with only a small loss, since your money continued to gain interest in the money market fund. If you were right and the market does tumble, you can get back in when you feel comfortable that a bull market has returned. This is not so much a strategy targeted toward trying to time your investments with the market, but can help keep your money invested at a risk level with which you feel comfortable.