Last year, the three major U.S. stock indexes entered bear market territory. And the market still is proving to be a difficult place. But if that's getting you down, the worst thing you could do is turn your back on investing. The one positive thing about a bear market is that it's an opportunity to snap up quality companies at bargain prices.

And you can take advantage of that opportunity right now. In fact, two of my favorite stocks are down by double-digit percentages so far this year. I'm talking about retail stars Etsy (ETSY 0.49%) and Target (TGT -0.54%). They've lost 31% and 10%, respectively. That leaves them trading at interesting levels. At the same time, their earnings have held up in spite of economic headwinds. And this makes them essential bear market buys.

1. Etsy

Etsy's earnings soared during the earlier days of the pandemic, when people favored shopping online. Today, higher inflation is weighing on the company's costs and on the wallets of shoppers, putting the brakes on its earnings growth.

But here's a big reason to be optimistic about Etsy: The online seller of handmade items actually kept most of the gains it made during the first stages of the crisis. For example, the gross merchandise sales on the Etsy marketplace were up by 164% in the first quarter compared to the same period back in 2019. And the number of active buyers was up 119% compared to Q1 2019.

Etsy also continues to generate profits, and it ended the first quarter with more than $1 billion in cash and equivalents on the books. What I really like about Etsy, though, is its capital-light business model. It offers sellers a platform to sell their wares -- and these sellers take care of their own logistics. This means it doesn't need to invest in the infrastructure for storing or shipping goods. As a result, it's able to transform most of its adjusted EBITDA into free cash flow.

Today, Etsy shares trade for less than 20 times forward earnings estimates -- down from a ratio of more than 30 just a few months ago. This is a screaming buy that could pay off big as the general economic environment improves.

2. Target

Like Etsy, Target's earnings climbed during the early pandemic days. That's because shoppers loved the discount retailer's e-commerce platform and its variety of pickup and delivery options. In recent times, though, macroeconomic woes have weighed on the company.

Still, Target has managed to keep growing -- even if at a much slower rate than before -- and keep customers coming back. In its most recent fiscal quarter, which ended April 29, Target's total sales inched 0.5% higher. And, importantly, traffic climbed for the twelfth consecutive quarter. This shows that even if shoppers are struggling with their budgets and spending less on discretionary items, they're still spending at Target.

Target also has proved it can manage difficult times. The company adjusted its inventory balance to favor essentials, which shoppers are buying more of these days. And thanks to its efforts, it produced operating cash flow of $1.3 billion in the quarter, compared to an outflow in the prior-year period.

Meanwhile, as you wait for the economy to improve and Target's share price to rebound, you can collect a generous dividend that currently yields about 3.2%. And Target's long history of raising its payout -- it's a Dividend King -- suggests that management is likely to continue boosting its dividends.

Considering all of these points, Target shares, trading at only 16 times forward earnings estimates, look dirt-cheap today.