After a tough year in 2022, the market seems to be in recovery mode in 2023. The tech-heavy Nasdaq Composite index has gained 31% since the start of the year, and some investors are talking about a new bull market (although it's not yet official). Still, there are some mixed signals regarding the economy, and not all stocks have returned to growth mode.

The federal funds rate, the Federal Reserve's benchmark rate, jumped from near zero to 5.5% at a very fast pace, rising to its highest level in two decades. Those high interest rates affect everything from commercial real estate to bank lending to auto sales to credit cards and more. That raises uncertainty about the broader economy and where it's headed over the next year.

For long-term investors, the goal is to own quality companies for the long haul. So when you buy doesn't matter greatly. But you can enhance those returns further by investing in quality companies when they trade at cheap valuations. Those instances often appear in a market downturn. Three stocks that I have on my watchlist to buy in the event the market goes south are Meta Platforms (META 0.43%), Roku (ROKU -10.29%), and Goosehead Insurance (GSHD 4.40%). Here's why.

1. Meta Platforms

Meta Platforms, which owns Facebook, Instagram, and WhatsApp, is a cash flow machine. This group of social media apps has helped Meta become one of the top players in the digital advertising space. According to market research firm Insider Intelligence, Meta's $113 billion in ad revenue in 2022 was the second highest globally, trailing only Alphabet's Google, which brought in $168 billion. 

But advertising is easily affected by the broader economy, and economic uncertainty in 2022 contributed to Meta stock going on a wild ride. Companies looking to cut costs in an uncertain economy resulted in a dramatic pullback in ad spending. There was also concern about Meta spending too much on new, unproven ventures. The market reacted and Meta's stock price plunged from $338 at the start of 2022 to $88 by October. At the low point, the stock sold at 2 times sales and 8.5 times its earnings -- Meta's cheapest valuation since going public in 2012.

In response, Meta made some significant cuts to expenses. The company has laid off over 20,000 employees and focused on what management dubbed a "year of efficiency." Since its low point last October, the stock price jumped 227% and now trades at 6.3 times sales and 33.5 times earnings -- putting it near its most expensive valuation on an earnings basis in five years. 

META PS Ratio Chart

META PS Ratio data by YCharts

There are still near-term headwinds to consider for Meta. If the oft-predicted recession actually arrives in the next year, it could lead to companies cutting ad spending again (or further), which could weigh on Meta's bottom line.

Meta is a top-notch company and a cash flow machine. It's a dominant player in digital advertising and should continue to be a key player in this industry, which Insider Intelligence expects to grow 8.5% annually through 2027. However, potential headwinds and its high valuation are why I have this on my watchlist as a top stock to buy in the event of a market downturn.

2. Roku

Roku is a pioneer in the streaming TV industry. In 2008, the company released its first set-top box that allowed customers to stream content online. Today the company is a top player in the industry, providing the technology to connect users to streaming platforms like Netflix, Walt Disney's Disney+ and Hulu, and Warner Bros. Discovery's Max. According to Pixalate, Roku has a 50% market share of the connected TV market. Its next three competitors, Samsung (21%), Amazon (13%), and Apple (5%), have less market share combined than Roku. 

Roku is a solid company, but its business faces a similar near-term headwind to Meta, a slowing advertising market. Fearing a potential recession, companies cut back drastically on advertising expenditures in the ad scatter market (the ad inventory that isn't bought up front), which Roku relies heavily on.

The pullback in ad revenue comes at the same time expenses are ballooning for Roku. Last year the company's revenue grew 13%, but expenses exploded 45% higher. As a result, its net income swung from $242 million in 2021 to a $498 million loss last year. In the first six months of this year, its net loss was $301 million, up from $139 million in the same period last year. 

Roku is well-positioned in the rapidly growing connected TV market, which Mordor Intelligence expects to grow by 13.2% annually through 2027. However, the company faces headwinds from a cutback in ad spend and rising expenses that will continue to weigh on its bottom line. If we get a market crash, I'd use that as an opportunity to invest in this growth stock with excellent long-term potential when ad spending recovers.

3. Goosehead Insurance

Goosehead Insurance is an insurance broker that could see explosive growth. The company sells insurance policies through its corporate segment and franchise segment. It's through franchising that Goosehead's growth potential arises.

Goosehead signs new franchisees to a 10-year term, with two optional five-year renewals. During the initial agreement, Goosehead earns a 20% royalty on any commissions a franchise generates. When franchisees renew their agreements, Goosehead's royalties jump to 50% of all commissions. This structure means Goosehead incurs heavy expenses upfront when onboarding franchises, but as those franchises mature and renew, it collects significantly more profits in the long run. 

While the long-term growth potential exists, today Goosehead stock trades at an expensive valuation of 5.7 times sales and 232 times earnings. Since going public, investors have been willing to pay up for its growth potential. Still, its valuation makes it more expensive than competitors like Marsh & McLennan, Arthur J. Gallagher, Aon, and Brown & Brown

Its lofty valuation suggests the stock could come down, especially if a market crash occurs. If that's the case, Goosehead is another stock with good long-term prospects that I would look to scoop up in a downturn.