A stock market crash is coming.

That's not a statement of doom. It's one based on history. At some point, the market will crash. Whether it be soon because of the coronavirus, or down the road due to reasons we don't see yet, it's going to happen.

It may not be possible to know when a crash is coming, but it is possible to prepare your portfolio for the inevitable. All three of these stocks make sense to own now, and they give you a measure of protection in the event of a market crash.

Workers at a Sam's Club.

Warehouse clubs are well-positioned to be well in a down economy. Image source: Walmart.

Costco

The warehouse club chain offers low prices and has incredibly high (roughly 90%) retention rates for its members. Costco (NASDAQ:COST) makes most of its profit from those members, and more people are likely to join in order to get access to the chain's cheap groceries, household goods, and assorted other items.

Costco's success is not tied to whether the economy is healthy. In fact, you could argue that consumers have more reasons to shop there during a recession or other financial downturn.

Dollar General

Dollar General (NYSE:DG) serves neighborhoods. Few, if any, people who shop at the chain go out of their way to get there. Instead, the company puts locations where they can serve a local community -- often one that is underserved by grocery chains.

When the economy tanks, people still need to eat. They still need toilet paper and other essentials. Dollar General offers all of those at cheap prices in locations that are easy to get to for their core customer base.

Walmart

Walmart (NYSE:WMT) will thrive during a market crash because, like the other two companies on this list, it offers consumers good bang for their buck. In a struggling economy, people will think twice about going to Whole Foods or paying more for grocery delivery.

They may also look to save money on clothing, household items, and pretty much anything else that they buy. Walmart checks off all of those boxes. The chain sells pretty much everything, and it has the Sam's Club warehouse chain as well, which offers the same value proposition as Costco.

Be careful, don't panic

A market crash only hurts you if you need money now. In many cases, it's a buying opportunity wherein you have a chance to build (or increase) positions in good companies that have the strength to weather the downturn.

If you're worried about a crash, however, it's smart to buy companies that thrive no matter what the economic conditions. That's not to say that Costco, Dollar General, and Walmart may not see their stock prices fall during a crash, but all three are well-positioned to recover fast.

When the market crashes, it's important not to panic. Remember why you bought the stocks in your portfolio in the first place. If those reasons remain true, then a downturn or crash is nothing more than a speedbump slightly slowing down your long-term plans.