Investors are hyper-concerned about the country falling into a recession in the next year or so. That worry is the key reason why markets are down so sharply in 2022 despite some encouraging unemployment and wage numbers through midyear. Given this concern, it's likely that the best returns will go to investors who can extend their time horizons further than most of Wall Street. That superpower is more valuable during a bear market like this when concerns over the short-term dominate headlines.

A recession doesn't necessarily mean a broken investing thesis. Many companies can thrive through a downturn and emerge stronger once the inevitable cyclical upswing occurs.

With that in mind, let's look at two attractive tech stocks that would be worth holding through a potentially rocky period ahead. Read on for good reasons to buy Netflix (NFLX 2.37%) and Garmin (GRMN 1.20%).

1. Netflix

Netflix might be ready to get itself back into Wall Street's good graces. The streaming video giant's stock plummeted through much of 2022 as growth stalled. Competition appears to be finally taking its toll and a flood of popular TV and movie releases seemingly failed to attract new subscribers through the first half of the year.

It is a mistake to write off Netflix now, though. The company aims to quickly return to growth with its upcoming earnings report (on Oct. 18) and has many other promising sales lines to target. These include video games and a crackdown on shared password accounts that number into the tens of millions. Just this week, the company announced a new ad-supported tier of service will start being offered on Nov. 3.

Netflix's service might become even more valuable in an era of tightening entertainment budgets, especially with the upcoming launch of its ad-supported pricing tier. And the company has improved its financial strength already, having just achieved positive cash flow while targeting many more years of growth on that key metric.

2. Garmin

Garmin might not be the first tech stock that comes to mind when you're worried about a recession, but this company can take a hit. Consider how its core automotive GPS business was disrupted by smartphones, and yet sales have risen in each of the last six years.

That's by design. Garmin has dramatically expanded its portfolio in the last decade, adding smartwatches and fitness trackers, but also pushing deeper into airplane and boating navigation. As a result, even the fact that Apple is targeting a key product niche shouldn't make a big difference to Garmin's overall growth trajectory.

Admittedly, Garmin's growth is decelerating, and its profitability is falling. Both pressures would be made worse by a recession. Yet the business has endured temporary stresses like these in the past, and each time the company emerged from the challenge with a stronger earnings profile.

In the meantime, investors can take advantage of the 40%-plus decline in the share price to cushion any risk of buying into the stock before a deep recession happens.

There's no way to know how any stock might truly respond to a recession. But with Garmin and Netflix, we have long track records to rely on that suggest the businesses will generate strong returns through whatever economic conditions develop over the next few years.