Look no further than 2020 for evidence that the long-term trend of the market is up. Despite an unprecedented global pandemic, it appears as though the S&P 500 will miraculously end this year up in the mid-teens.

Nevertheless, we shouldn't forget we've had two massive downturns in just the past two years, which can be awfully scary if you're not prepared. One thing's for sure -- we'll get another. It may be in 2021; it may be further out. But another big downturn will most certainly happen at some point over the next five years.

After this year's big gains, some investors may be looking to lock in some profits and preserve capital, especially those in or near retirement. Nevertheless, stocks still seem like the best place for long-term savings, given that bonds yield next to nothing and most asset classes remain somewhat highly priced. 

The solution? Position your portfolio defensively, in companies that can weather a big storm or even capitalize on the next recession.  

With high-flying IPO stocks trading at nosebleed valuations and many "reopening" stocks already pricing in a recovery, here are three rock-solid defensive stocks you can confidently hold through the next downturn.

A young investor in a suit cringes as the drawing of a downward pointing arrow breaks above him.

Images source: Getty Images.

Berkshire Hathaway

One of the best ways to protect your net worth is to throw your money in with the most practical, risk-off investor of all time: Warren Buffett. The Oracle of Omaha's conglomerate Berkshire Hathaway (BRK.A -0.32%) (BRK.B -0.67%) has actually lagged the overall stock market for the past one-, five-, and 10-year periods.

BRK.A 1 Year Total Returns (Daily) Chart

BRK.A 1 Year Total Returns (Daily) data by YCharts.

Still, this may be a function of the growth-obsessed market we're currently in, with investors paying very high prices for young companies with exciting potential. In comparison, Buffett's Berkshire may seem downright old-fashioned.

Yet that's overlooking the topic of risk. As Buffett once said in his 2001 letter to shareholders, "You only find out who is swimming naked when the tide goes out."

Buffett and his partners have built the current Berkshire into a collection of businesses with highly defensive characteristics. After all, insurance doesn't fluctuate with economic cycles but with the random frequency of disasters and claims.

Another huge business at Berkshire is its Berkshire Hathaway Energy unit, which is a huge utility and energy business that covers the U.S., Canada, and Great Britain, and which is also highly defensive. Another major "utility-like" Berkshire business is Burlington Northern railroad. All of these business units remained profitable during the downturn of 2020, with Berkshire Hathaway Energy even increasing profits.

Then, of course, comes Berkshire's large investment portfolio, which consists of wholly owned businesses and $245 billion in public stocks as of Sept. 30. One of the greatest investors of all time, Buffett and his team mostly invest in wide-moat stocks with solid staying power at reasonable valuations. And being highly cautious, Berkshire held about $142 billion in cash at the end of last quarter, giving Buffett and his team the optionality to pick up discounted companies should disaster strike again.

Many investors have ignored Berkshire this year as the market bounced back much too fast for Buffett to swoop in with many large, consequential buys. Additionally, Buffett sold out of several Covid-affected stocks, like airlines, at or near the 2020 bottom.

However, trading at just 1.28 times book value, Berkshire still looks awfully cheap, compared to just about any other large-cap company. Its industrial and manufacturing businesses should also bounce back after a vaccine, making shares look like a bargain for today's defensive investor.

Teenage girl with headphones smiles in a warehouse store.

Image source: Getty Images.

Costco

When times get tough, families look for necessities at a big discount. That likely means heading to Costco Wholesale (COST 0.01%) for its unbeatable prices on bulk items.

Operating as a membership club, Costco actually earns most of its profits from annual membership fees, which start at just $60 per year. Those membership fees allow Costco to continue cutting prices, essentially selling products and services near breakeven to its customers.

Once you become a Costco member, you aren't likely to find a better deal anywhere else. Even in this pandemic year, Costco was able to increase its same-store sales in the mid-teens as it rolled out enhanced safety measures and grew its e-commerce business. Last quarter, Costco grew its e-commerce business by 86.4% and increased overall same-store sales by 15.4%.

Not only that, but Costco still has a long runway for growth, especially internationally. The company has only one store open in China today, but it appears to be a success. If the company can increase its presence in the world's second-largest economy over the next decade, it'll be another huge win.

As a defensive consumer staple, Costco's stock decreased less than most other stocks in the market during the March swoon. And by December, it rewarded shareholders with a special $10 dividend, a bonus the company has rewarded shareholders with every few years for the past decade. For defensive-minded investors, Costco will definitely help you sleep well at night.

A hand touches a cloud icon floating in the air.

Microsoft is a defensive play on cloud and gaming. Image source: Getty Images.

Microsoft

Finally, the most defensive way to play the red-hot cloud computing sector is Microsoft (MSFT 0.30%). At the core of Microsoft today is its high-growth Azure cloud computing platform, which grew by 48% last quarter and is already a strong No. 2 player behind Amazon's AWS.

We're still in the relatively early innings of enterprises migrating their infrastructure to the cloud, and Microsoft seems well-positioned as one of the three big U.S. companies primed to benefit. Last year, Microsoft earned its bona fides as not just a second-place player but as a potential leader after it won the $10 billion JEDI cloud contract from the Department of Defense.

Cloud computing is a utility-like service that's also high growth, adding a terrific business to Microsoft's already-impressive roster of enterprise-software products like Office and Dynamics. Microsoft is also the owner of business social media network LinkedIn, code repository GitHub, and the Xbox gaming platform, which just released its first new console in seven years.

These highly profitable growth businesses, along with a healthy $137 billion in cash on the balance sheet, make Microsoft a highly defensive and growth stock all at once. When you look at it that way, the company's 35 price-to-earnings ratio doesn't seem so expensive, after all.