In a bear market, it's easy to be pessimistic about stocks and to expect the worst. But assuming that things will progressively get worse is just as illogical as assuming that a company will keep on growing at a high rate when times are good. That's why focusing on the long term is the safer strategy, as that can shift focus away from the short term and the problems at hand today.

Two stocks that investors are overly bearish on right now are Teladoc Health (TDOC -0.07%) and Alibaba Group Holdings (BABA 2.92%). In the past 12 months, both stocks have crashed more than 40% while the S&P 500 has declined just 7%. But if you're willing to take on some risk and be a contrarian investor, you could earn some great returns from buying and holding these stocks and going against the grain.

1. Teladoc Health

Down a whopping 77%, Teladoc has been one of the worst-performing growth stocks of the past year. Although the business is still growing, investors are likely having a hard time getting past the $9.6 billion the company has written off its books through the first six months of the year due to goodwill impairment charges. It's an awful number to see given that Teladoc's entire market cap right now is barely half that figure, around $5.5 billion.

Investors have punished the company for those writedowns. But dumping the stock might be a huge mistake, as the company has proven to be resilient, with the telehealth provider generating sales growth even at a time when many bearish investors might have assumed its growth would end -- in a return to normal in the economy in which demand for virtual visits could falter. Through the first two quarters of the year, the revenue of $1.2 billion has been up 21% year over year, and virtual visits of 9.2 million are 31% higher than they were a year ago.

The company still struggles with profitability, but if not for the mammoth impairment charges, it would be showing improvement, as its net losses over the first six months total less than $9.8 billion. Without the impairment, the year-to-date net loss would be $146 million -- less than half what it was it in the prior-year period.

The telehealth sector is expanding at a rapid rate, with Fortune Business Insights projecting the global market to grow at a compounded annual growth rate of more than 32% until 2028. Meanwhile, Teladoc has been signing up more clients on its Primary360 service, a virtual primary care service that offers flexibility and personalized support. Down around 80% from its 52-week high, the healthcare stock is almost a no-brainer buy at this point given the potential Teladoc has in the long term, especially as employers look for ways to trim the cost of their healthcare plans.

2. Alibaba Group Holdings

Alibaba has been struggling for multiple reasons, and COVID lockdowns in China have weighed down the second-largest economy in the world. The tech company's growth rate stalled last quarter, with sales of $30.7 billion for the period ending June 30 being flat from a year ago. Alibaba's core business is e-commerce, but one of the more promising areas of its operations of late has been its cloud segment, which brought in $2.6 billion in revenue last quarter and grew 10% year over year.

Analysts from Morgan Stanley expect that China will open back up toward the end of the year and move away from its COVID-zero policy. If that happens, Alibaba's top line could bounce back and resume showing more positive growth numbers.

The bigger long-term risk investors are likely worried about is the danger that Alibaba's stock could get delisted from the U.S. stock exchange in 2024 if the company doesn't open its books to U.S. auditors. Analysts from Jefferies believe the issue is overblown, however, noting that China does want to resolve the audit problems. Although it's a concerning issue, delisting is a result that would benefit no one in the end: not the company, not either country, and certainly not investors. That's also why I believe it makes sense that a compromise will be reached so that the scenario can be avoided. But it is a risk nonetheless and one that investors need to consider.

If you're willing to take on that uncertainty, the long-term gains could be significant, as Alibaba's stock is down 50% from its 52-week high and is trading at a forward price-to-earnings multiple of 11. By comparison, the average stock in the Technology Select Sector SPDR Fund trades at 24 times its future profits.

In a year or two, Alibaba could look like a steal of a deal at its current price.