Warren Buffett once said: "All there is to investing is picking good stocks at good times and staying with them as long as they remain good companies." That advice is especially relevant right now. The Nasdaq Composite has slipped into a bear market, and many stocks have fallen sharply during the downturn.

For instance, Microsoft (MSFT -2.45%) and Netflix (NFLX 1.74%) have seen their share prices plunge 26% and 54%, respectively, marking their worst declines of the past decade. That could also mean that investors have a once-in-a-decade buying opportunity. Here's why the future looks bright for both businesses.

Microsoft: Best software company in the world

Microsoft ranks as the fourth-most-valuable brand on the planet, according to Brand Finance, and it was recognized as the best global software company by G2 based on strong market presence and user satisfaction. Windows is the most popular operating system across personal computers and data center servers. Microsoft 365 is the most popular enterprise application suite of any kind, and it includes a number of industry-leading software tools that address a broad range of use cases, such as office productivity, cybersecurity, communications, and business analytics.

Microsoft Azure is the second-largest cloud computing platform in terms of market share. It accounted for 22% of cloud infrastructure spend in the most recent quarter, and its focus on developer tools, machine learning services, and hybrid cloud solutions should help the company maintain its momentum in the coming years.

Microsoft is not immune to economic headwinds. High inflation has led to weak PC demand and reduced ad budgets, and management expects those trends to weigh on its Windows and ad tech businesses in the near term. But Microsoft still delivered solid financial results over the past year. Revenue increased 15% to $203 billion and free cash flow climbed 5% to $63 billion.

Going forward, Microsoft is well-positioned to deliver double-digit revenue growth through the end of the decade. According to Grand View Research, cloud computing spending will grow at 16% annually to reach $1.6 trillion by 2030, while cybersecurity spend will grow at 12% annually to reach $500 billion over the same period.

Microsoft shares currently trade at 27 times earnings, a discount compared to the five-year average of about 35. That's why this growth stock is a buy.

Netflix: Most popular streaming service in the world

Over the past year, streaming giant Netflix has ranked among the 10 worst-performing stocks in the Nasdaq-100 index. Several factors contributed to that fall from grace. Most notably, the company lost subscribers in the first and second quarters, and revenue has decelerated in each quarter since the beginning of 2021. But those troubles can be traced back to economic turbulence.

High inflation has muted consumer spending, putting pressure on Netflix's ability to add new subscribers. That dynamic coupled with unfavorable foreign exchange rates has suppressed financial growth. For instance, Netflix reported 6% revenue growth in the third quarter, but revenue increased 13% on a currency neutral basis. Fortunately, the challenging economic environment is a temporary problem, and it does not change the long-term investment thesis.

Despite an onslaught of competition, Netflix remains the most popular streaming service by almost any metric. It was the most downloaded video streaming app worldwide during the first half of the year, according to Apptopia. Netflix held over 40% global market share in demand for original content in the third quarter, according to Parrot Analytics. And it currently owns eight of the top 10 original streaming programs in the U.S., and six of the top 10 streaming movies in the U.S., according to Nielsen.

In other words, Netflix is engaging viewers more effectively than its competition, and that puts the company in a great spot. Netflix recently debuted a less expensive ad-supported streaming plan, a move that significantly expands its total addressable market. According to eMarketer, the subscription video market will grow at 7% annually to reach $118 billion by 2027, but the online video advertising market will grow at 14% annually to reach $362 billion by 2027.

Management says the new ad-supported offering "will lead to a significant incremental revenue and profit stream." And with the shares trading at 4.6 times sales -- a bargain compared to the five-year average of 8.5 -- it's worth buying a few shares of this growth stock.