If you find yourself wondering how long the economy can keep humming along, you're not alone. Bull markets and buoyant economies don't last forever, and investors who don't want to get blindsided when the going gets rough may want to learn how to prepare for a recession.

Selling every stock you own and stashing the proceeds under your mattress is an option for worrywarts, but I'm an investor. I want to profit in good times and bad. I have three stocks that I think will thrive in an economic downturn, so even in a world where stock prices are heading lower, these will be salmon working their way upstream -- ideally not getting mauled by a bear. I think Roku (ROKU 5.41%), The RealReal (REAL 4.23%), and Amazon.com (AMZN 1.30%) have what it takes to make the most of the next inevitable downturn. 

An Amazon Prime Air drone against clouds.

Image source: Amazon.com.

Roku

One of this year's hottest stocks, soaring better than fivefold, has you right where it wants you when the going gets tough: in your living room. Roku's streaming video hub is the platform of choice for smart television manufacturers, and its own hardware is selling briskly across several retail partners. Roku's audience has risen 36% over the past year to hit 32.3 million active accounts, with the average account streaming more than 3.4 hours a day. 

One can expect that Roku's user base will continue to expand during a downturn, and with folks staying home more often but still in need of entertainment as a form of escapism, that will only spice up engagement. Roku makes money through advertising and sign-up referrals from the thousands of apps available on its platform. The ad market may get rattled during a downturn, but streaming video services will get hungrier for the leads Roku can generate as the top dog in this field. If you think Roku is popular now, just wait until other forms of entertainment become difficult to justify in constricted budgets. 

The RealReal

The luxury goods market would seem to be toast in a recession, but The RealReal is sitting pretty as the leading online marketplace in authenticated luxury consignment. The platform sells secondhand clothing, fine jewelry, watches, fine art, and home decor, all authenticated by an expert. 

Big-ticket items will take a hit in a pronounced economic downturn, but let's think things through. Cash-strapped owners of luxury items will want to sell some of their wares to achieve liquidity, and The RealReal is there with its proven platform that had 542,987 active buyers as of its latest financial update. Folks in the market for luxury goods will want to get more bang for their buck during a recession, and authenticated consignment merchandise offers a more economical way to nab desired items. 

Increased interest from both buyers and sellers will enhance the network effect that The RealReal already has, and then we get to the beauty of the model itself. Unlike traditional retailers that can sometimes work on lean markups when it comes to discounted goods, it's a different game when it comes to consignments with sellers willing to give The RealReal more than a third of the proceeds -- its take rate has widened to 36.8% -- for doing all the legwork to get luxury items in the hands of new owners.  

Amazon.com

Amazon as an investment wasn't immune to the the last recession. Its shares plummeted along the with the general market in 2008 during the global financial crisis, despite coming through with a 29% revenue increase that year. However, e-commerce has become far more acceptable as a shopping platform since then. Folks looking to save money during an economic hiccup will rely even more on Amazon's low prices, but the leading online retailer also has improved its chances of cashing in during a downturn over the past 11 years. 

If Roku is a winner because folks will be spending more time at home, then Amazon will succeed with its Prime Video offering that's available to Amazon Prime customers at no additional cost. Digital rentals through Amazon will also help replace costlier trips to the local multiplex. Amazon's push into groceries -- offline and online -- gives it a strong foothold in a defensive industry selling essential and basic consumer staples. Behind the scenes, Amazon Web Services also continues to be a popular choice for companies seeking scalable and aggressively priced cloud computing services, and a soft economy will only be a catalyst for companies to become more efficient by shifting as much of their operations as they can to the cloud. Amazon will always be at its best when folks are spending more, but it's positioned itself well to keep winning even when the economy is not.