According to Warren Buffett, investors should "attempt to be fearful when others are greedy and to be greedy only when others are fearful." With major indexes reaching new all-time highs, the market sure looks greedy -- and the next correction may be just around the corner. 

There are many reasons why the S&P 500's winning streak could suddenly end. A second wave of the COVID-19 pandemic, a lethal mutation in the coronavirus, or COVID-19 vaccine candidates failing major clinical trials are just a few of the potential risks ahead. Long-term investors should consider putting $5,000 into these three stocks that can enrich them for years to come, even when others are fearful. 

Family video chatting with doctor.

Image source: Getty Images.

1. Teladoc Health 

Fear of the coronavirus has led to a surge in demand for patients seeking virtual visits with their physicians. Teladoc Health (TDOC -0.72%) is one company that has made this a reality. In its quarter ended June 30, the number of paid members on its telemedicine platform increased by 92% compared to last year, to 51.5 million.

While its membership count increased, the frequency of visits also increased. During the same period, 16% of its paid members sought a physician visit, compared with 9.1% in the second quarter of 2019. As a result, the company's revenue grew by a staggering 85% year over year to $241 million.

What's more, Teladoc recently announced the acquisition of Livongo Health (LVGO), a digital diabetes management company, for $18.5 billion in cash and stock. That is excellent news for Teladoc because it offers so many opportunities for synergy. In the future, patients with chronic health conditions, such as diabetes, who seek virtual physician consults can do so on Teladoc's platform and receive a referral to sign up for Livongo's namesake app to manage their condition.

The two companies expect to generate over $500 million in revenue synergies by 2025. Combined, Teladoc and Livongo may generate up to $1.3 billion in sales this year, representing 85% growth compared to 2019. With telemedicine being one of the hottest sectors right now, I have no doubt shares of Teladoc can generate wealth for investors over the long term.

Programmers working on computer.

Image source: Getty Images.

2. The Trade Desk 

The Trade Desk (TTD 1.07%) provides a self-serve digital platform to advertisers who choose from over 500 billion ad opportunities per day. The company's innovative personalized marketing model has allowed it to become the frontrunner in disrupting a $750 billion global ad spending market.

With ads on social media, mobile apps, videos, audio, and desktop displays, the company is omnipresent. The Trade Desk reaches more than 80 million households and 120 million devices in the U.S. alone.

The business has been incredibly resilient in the face of the COVID-19 pandemic. While skeptics argued that the ongoing recession would likely destroy discretionary spending, The Trade Desk posted a profit in the second quarter of 2020, maintaining the streak of profitability it's enjoyed since 2013.

Last year, advertisers spent more than $3.1 billion on The Trade Desk's platform and brought in over $660 million in revenue for the company. This year, the company still managed to generate $300 million worth of sales in the first six months. Its stock has fully recovered from the sell-off related to COVID-19, and I expect its momentum to continue as the transition to a digital economy accelerates.

Online business owner looking at laptop while preparing deliveries for clients.

Image source: Getty Images.

3. Shopify 

The coronavirus outbreak has become a catalyst for e-commerce. Retailers moved online en masse in response to government-imposed quarantine and lockdown measures to contain the virus. In the second quarter, revenue at do-it-yourself e-commerce platform Shopify (SHOP 1.48%) increased by 97% year over year. At the same time, the company's net income increased more than tenfold, to $129.4 million.

Thanks to robust demand, about $13.4 billion worth of merchandise was processed by Shopify Payments, representing a 132% increase since last year. Meanwhile, the company launched its Shopify Capital program to finance new merchants as they kick-start their stores on its platform. As of late June, over $1.2 billion in funding had been handed out.

Currently, the company has about $4 billion in cash and investments with no debt whatsoever. Thanks to skyrocketing revenue, improving profitability, and healthy financials, this is a stock investors will not want to miss