Every investor is guaranteed to go through challenging periods on the stock market at some point. When that happens, it is tempting to resort to panic selling. But unless the prospects of the companies whose shares one owns have changed, panic selling is rarely the right move.

It's usually best to stay put through downturns and heightened periods of volatility. Doing so will lead to greater returns over the long run, at least for the right stocks. After last year's bear market, many investors undoubtedly have stocks in their portfolios that remain substantially down over the trailing-12-month period.

Here are two that I own and intend to keep despite their poor recent performances: Roku (ROKU 1.58%) and Block (SQ -1.68%). Let me explain. 

1. Roku

Roku encountered several problems tied to broader economic issues over the past year. The company's revenue felt the pressure of a shrinking advertising market, while its expenses soared partly due to inflation. These problems will linger a while longer. For instance, management notes that the U.S. advertising market was down 7.4% year over year in the first quarter, and it expects the second quarter to see a similar trend.

Yet, although it is still down 30% over the trailing-12-month period, Roku's stock has performed well this year. There are likely several reasons for that. First, broader equity markets are bouncing back in 2023. No doubt Roku is benefiting from this rebound. Second, the company's valuation had become attractive enough to entice enough investors to purchase shares. Even now, Roku's forward price-to-sales ratio stands at 2.3.

Anything under 2 is usually considered "good," and Roku was in that range at the start of the year.

ROKU P/S Ratio (Forward) Chart.

ROKU P/S Ratio (Forward) data by YCharts.

Third, and perhaps most importantly, Roku still has excellent long-term prospects. Inevitable economic cycles will do little to change that. That's because Roku's future is tied to the seemingly unstoppable growth of the streaming industry. One need only look at the number of streaming services that have popped into existence over the past five years to get an idea of the prospects here.

Some of the world's largest and most prominent corporations are dipping their toes in these waters -- including tech giant Apple. That's a dead giveaway that there is a substantial opportunity here. However, Roku is not in competition with Apple, Netflix, Disney, or other streaming platforms. Instead, it provides an avenue to accommodate viewers, advertisers, and streaming services. Whoever comes out on top of the battle in streaming, Roku will benefit.

The company already boasts nearly 72 million active accounts, which increased by 17% year over year in the first quarter. But that's still a relatively small number when looking at the worldwide opportunity, especially outside of developed nations like the U.S., where streaming is most advanced. Roku could continue growing its accounts and revenue for many years, especially once the advertising market inevitably bounces back.

That's why I am holding onto my shares in the company.

2. Block 

Fintech specialist Block has performed well considering the economy, but a few issues have slowed the company's progress. First, Block's Bitcoin (CRYPTO: BTC) based revenue has been a drag on its top-line growth, which is in line with the substantial decline the cryptocurrency market experienced last year. Second, a recent short-seller report targeted Block with a litany of serious accusations, leading to a drop in the stock price.

That said, as a shareholder, I was not particularly impressed with the short-seller report. And while the crypto market is volatile and uncertain -- which complicates Block's Bitcoin-related ambitions -- the company's two main ecosystems are performing well. First, Block's Square ecosystem offers point-of-sale systems and other services to help small and medium-sized businesses run their operations smoothly and efficiently. 

Second, the company's Cash App provides various financial services, from tax preparation to stock trading and a debit card. Cash App especially targets underbanked communities. In the first quarter, Block's revenue increased by 26% year over year to $4.99 billion. The company's total gross profit of $1.71 billion was 32% higher than the year-ago period. Cash App gross profit soared by 49% year over year to $931 million.

Square's $770 million gross profit was 16% higher than the first quarter of 2022. Both Square and Cash App should continue to grow as Block adds more offerings to these ecosystems to address the needs of its customers better. A relatively recent addition to Cash App was that of buy-now-pay-later (BNPL) capabilities, allowing customers to buy things on "credit" (or in installments) but often without the interest typically attached.

Consumers on the app can look for retailers that accept BNPL. They can also look for sellers that accept Cash App Card discounts. In the first quarter, Block reported that it now has 20 million monthly Cash App Card activities, an increase of 34% year over year. 

Block is also making effective use of AI. Through Square Messages (a feature that allows businesses to communicate directly with customers), Block recently launched Suggested Actions, which utilizes AI to recommend the next actions sellers should make based on conversations in Square Messages. The feature helps save sellers time while helping drive greater engagement -- and, potentially, greater conversions -- with customers.

That was just one of about 100 new features Block recently introduced on Square. Block should continue growing thanks to its constant fine-tuning of its services for the benefit of its customers and the still enormous fintech opportunities ahead. So even as its shares are down by roughly 20% over the past year, investors should stay the course.