The S&P 500 index has climbed in the double digits since the beginning of the year. But that doesn't mean the opportunity to snap up cheap stocks is over. You can grab great bargains in any stock market environment -- even when indexes are rallying. How can you find these stock market jewels? By looking for quality companies that have struggled in recent times or those that simply have fallen out of favor.

Two perfect examples right now are entertainment giant Disney (DIS -0.04%) and toymaker Mattel (MAT -0.60%). Disney's declinedfar this year even as its new recovery plan is bearing fruit. Mattel has climbed but still trades at a reasonable price -- and has plenty of room to run over the long term. Both of these players could not only spread joy among customers, but they also could make investors smile over time. Let's take a closer look at these two cheap stocks to buy without any hesitation.

1. Disney

Disney has experienced some tough times in recent years. The pandemic temporarily shut down its theme parks and drove the company to an annual loss. Then, aggressive investment in its streaming services and higher inflation weighed on costs.

But things are looking brighter at Disney today. The company brought back former chief executive officer Bob Iger -- who drove earnings and share price gains during his tenure -- to cut costs and drive growth. Iger signed on for two years, but Disney recently extended the term through 2026. This is good news because it will offer Iger the time needed to truly turn things around.

His efforts already are showing results. In the most recent earnings call, Iger said Disney is on the road to surpassing its $5.5 billion cost savings goal. The CEO's strategy involves focusing on Disney's creative strengths, producing only the highest-quality film projects, and finding ways to maximize the earnings potential of all of its businesses. For example, the company aims to eventually shift its ESPN network to streaming. And speaking of streaming, Disney sticks by the goal of making that service profitable by the end of fiscal 2024.

Disney shares haven't reflected the company's progress so far. This year, they've lost about 3%, and that means they trade for only 22 times forward earnings estimates. That's compared to more than 30 earlier this year. This is a bargain for a company that, thanks to its leadership in the entertainment world and a solid strategy today, should excel over time.

2. Mattel

Mattel also is emerging from a difficult period. A tough economy has weighed on households, which has led to lower spending on toys. In recent months, toy retailers struggled to manage high levels of inventory -- and that translated into lower sales for Mattel.

But this is a short-term challenge -- and investors who aim to buy and hold Mattel shares could benefit from growth over the long haul. The company has what it takes to make that happen. Mattel holds a solid portfolio of intellectual property, including brands we all know such as Barbie, Hot Wheels, and Fisher-Price. In fact, Mattel calls these three its "power brands."

Mattel aims to broaden the earnings potential of these brands -- and it recently did so by releasing Barbie, the movie, through its Mattel Films business along with Warner Bros. Barbie, having brought in more than $1.3 billion since its July release, has become Warner Bros.' highest-grossing global release. Mattel signed more than 165 partnerships for products related to the film. And, after many Barbie-related items sold out, Mattel aims to release others in the coming months.

Though today's economic situation still is hurting toy sales, the company has managed to grow free cash flow and gain market share.

MAT Free Cash Flow Chart

MAT Free Cash Flow data by YCharts

To show its confidence in its own business, Mattel also has resumed share buybacks.

Mattel shares have advanced 24% this year. But considering the company's solid portfolio of brands and the potential to expand earnings through films and partnerships, the stock could continue to progress over time. That's why, trading at less than 20 times forward earnings estimates, Mattel shares look like a top buy right now.