The economy appears to be humming along nicely these days, but it won't always be that way. There will come a time -- it may be in a few weeks, months, or even years -- when the going will get tough. It's inevitable. It's natural. You still need to prepare for a recession.

Let's go over a few ways to get your portfolio ready for the next economic downturn. Don't panic: You may already be closer than you think. 

A downward facing arrow across a background of $100 bills.

Image source: Getty Images.

1. A bulletproof portfolio isn't the best portfolio

The only way to achieve a truly recession-resistant portfolio isn't pretty. You would have to sell your stocks, your corporate bonds, and likely even your fixed-income mutual funds. The only way to assure yourself of a nearly bulletproof portfolio is to load up on money market funds, CDs, and high-quality (and ideally short-term) government bonds. And in that scenario, you'll be lucky to break north of a 2% annual return. 

There's nothing wrong with a 2% return when the sky is falling, but since no one can truly nail the top or bottom of any economic cycle, you'd be sitting in historically underperforming asset classes for a potentially long time that way. You don't want to go cold turkey on stocks, though some diversification isn't necessarily a bad thing.

2. Identify stocks and trends that will thrive in a downturn

You can have your cake and eat it, too. Most stocks will slide during a recession, and that's understandable. But even in a Wall Street swoon, there can be winners if they're built to not only survive but potentially thrive in a market downturn. 

Most stocks took a beating during the last meaningful economic slowdown, the global financial crisis of 2008. The S&P 500 plunged a brutal 38.5% that year, but not every stock buckled. Some of the rare winners that rose in 2008 include Netflix (NFLX -0.63%) and Panera Bread. 

Netflix makes sense. Market downturns turn us into homebodies, and Netflix -- at the time largely specializing in DVD rentals by mail -- offered a tempting value proposition for entertainment-hungry consumers who couldn't justify paying for a night at the movies or other drive-to weekend events.

Panera (now privately held) was a bit of an enigma since restaurants generally fare poorly during recessions. But its fresh-baked sandwiches and warm soups provided quick-service comfort food at a time when the country needed it. 

Sit back and look at where we will spend money during the next recession. You can also reverse-engineer this exercise by looking at industries that will be the hardest hit during a market downturn and then figuring out the beneficiaries. We will still be tempted to stay home for entertainment, but this time around, Roku (ROKU -10.29%) seems like a better play than any individual streaming service. Roku makes money even when its growing user base trades down to free video services on its platform, and it will probably be the better Netflix in a cash-strapped consumer scenario. 

The gig economy will come in handy when corporate layoffs strike. Supermarkets and warehouse clubs will take the baton from eateries and restaurant-delivery platforms. I recently looked at some potential winners during the next recessions -- including Roku -- but you can probably think up some great possibilities that didn't occur to me once you play things out.

3. Dividends matter in a recession

Growth and even value investors don't necessarily pay attention to dividend yields when the going is good. Capital appreciation is where the real money is made in the stock market. But there's no denying that quarterly distributions can help provide a floor when the equity markets take a hit. 

I recently took a look at some attractive stocks packing yields north of 4%, but they are consumer-facing companies that may not fare so well during a market downturn. Dividends help cushion the blow for investors, and if interest rates are moving lower during a recession, it only helps emphasize the attractiveness of yields in stocks with sustainable payouts. The key to successful investing in dividend stocks is finding stocks earning a lot more than their distributions, and ideally focus on companies that have been coming through with annual dividend hikes for years. 

You've got this. Don't panic, just put on your thinking cap and assemble a portfolio that will thrive in good times and bad.