With the S&P 500 near historic highs, many investors are likely losing sleep over the possibility of a major market crash. If that sounds like you, these three resilient stocks might help you rest easier -- Waste Management (WM 0.60%), Johnson & Johnson (JNJ 0.29%), and Wal-Mart (WMT -1.75%).

Waste Management

Waste Management is the biggest waste management company in North America. It serves over 21 million customers with a vast network of recycling facilities, landfills, and transfer stations. The company recycles about 15 million tons of garbage annually, and powers around half a million homes with its renewable landfill-gas-to-energy technology.

A Lego figure pushing a recycling bin.

Image source: Pixabay.

Waste Management is an ideal "buy and forget" stock because it generates consistent growth with minimal competition in its main markets. The company's revenue rose 5% to $13.6 billion in fiscal 2016, fueled by positive yield and volume in its collection and disposal business. Free cash flow rose 18% to $1.66 billion, and its adjusted earnings rose 11% to $2.91 per share. Analysts expect 5% sales growth and 9% earnings growth this year.

Those stable returns enabled Waste Management to hike its dividend annually for 13 straight years. Its current forward yield of 2.3%, which is supported by a payout ratio of 60%, is also higher than the S&P 500's 2% yield. The stock's P/E of 27 remains much lower than its industry average of 42, even though shares have more than doubled over the past five years.

Johnson & Johnson

Johnson & Johnson is another slow-growth stalwart that has recovered from many devastating crashes in its 73 years as a public company. Today, the healthcare giant's business is so well-diversified across the pharmaceutical, consumer healthcare, and medical device markets that it's hard for any major setbacks to leave a lasting mark.

J&J's Band-Aids.

Image source: J&J.

Between fiscal 2006 and 2016, J&J's annual revenue rose 35%, its adjusted earnings grew 80%, and its stock price nearly doubled. Analysts expect J&J's revenue and earnings to respectively grow 5% and 6% this year, despite recent headwinds like currency fluctuations, generic competition for some of its top drugs, and lawsuits regarding some of its products.

That slow and steady growth has enabled J&J to raise its dividend annually for over five decades, making it one of the elite "dividend aristocrats" which have hiked their payouts for at least 25 straight years.

It currently pays a forward yield of 2.6%, and its low payout ratio of 53% indicates that there's still plenty of room for future hikes. J&J's P/E of 21 also remains lower than its industry average of 26, even after the stock's big gains over the past few years.

Wal-Mart Stores

Wal-Mart might initially seem like a weak long-term play due to the growth of e-commerce giants like Amazon (AMZN 1.30%). But over the past few years, Wal-Mart has taken big steps to ensure that it remains relevant in an e-tailer's market. It invested more heavily in its mobile app and payments ecosystem, added same-day delivery and curbside pickup options to counter Amazon, and offered to match the prices of online retailers.

The interior of a Wal-Mart store.

Image source: Wal-Mart.

Wal-Mart has one key advantage over Amazon -- the ability to use over 5,000 stores and clubs nationwide as a distribution network to counter Amazon's fulfillment centers. It also recently started offering discounts for in-store pickups from online orders.

The company's turnaround efforts -- which include raising wages, improving training, expanding its e-commerce presence, and reorganizing stores -- have also been widely praised by analysts.

Between fiscal 2007 and 2017, Wal-Mart's revenue rose more than 40%, its adjusted earnings more than quadrupled, and its stock rallied nearly 40%. Like J&J, Wal-Mart is a dividend aristocrat that has hiked its payout annually for over four decades. Its current forward yield of 2.7% is higher than the market average, and is easily supported by its payout ratio of 46%. The stock also isn't expensive at 17 times earnings, which is lower than its industry average of 18.

The key takeaway

There's no such thing as a risk-free stock, but I believe that Waste Management, J&J, and Wal-Mart come close. These stocks might stumble with the overall market during the next big downturn, but they'll likely bounce back as they've repeatedly done after previous crashes.