Stock prices tend to be volatile. It is difficult to predict how a stock may move in a month or two. Rather than trying to time the market, a far better way to generate solid returns is to buy top-quality stocks and hold them for the long term.

Two such stocks in the clean energy sector are Brookfield Renewable Partners (BEP 1.40%) and NextEra Energy Partners (NEP 1.18%). Let's discuss why.

Brookfield Renewable Partners

Brookfield Renewable operates around 21 gigawatts of clean energy assets spread across hydro, wind, solar, and distributed generation. While that already makes it one of the largest clean energy companies, what is more attractive is that it has a development pipeline of 69 gigawatts of projects. That's more than triple the company's existing portfolio. For the project pipeline, Brookfield Renewable targets annual capital deployment of $1 billion to $1.2 billion for the next five years.

More and more countries are committing to decarbonization and net-zero emissions. This is drawing more investments and operators in the clean energy segment. Despite the progress so far, we are at the very initial stages of an energy transition that encompasses several sectors.

Power generation is a crucial area and there is an increasing focus on wind and solar generation. The falling cost of wind and solar generation has already made them compelling. What's more, costs continue to fall. In a nutshell, we will see ever-growing use of these sources in the coming decade and beyond.

Brookfield Renewable has a track record of more than two decades of delivering strong performance. Between 2001 and 2022, the company increased its per-unit distribution at a compound annual growth rate of 6%. Brookfield Renewable's global reach, wide-ranging expertise, and large-scale operations allowed it to deliver the impressive performance.

Brookfield Renewable's cash flows are diversified across clean technologies and geographies. Around 90% of its cash flows are contracted, with an average term of 14 years. These factors contribute to the stability of the company's cash flows.

In all, Brookfield Renewable Partners looks well positioned to continue its long-term outperformance in the coming decade, too.

NextEra Energy Partners

NextEra Energy Partners, a subsidiary of NextEra Energy (NEE 1.57%), owns and operates clean energy projects. The company has interests in wind and solar projects, as well as natural gas infrastructure. NextEra Energy Partners has a portfolio of around 8.3 gigawatts of wind and solar assets. Additionally, it operates roughly 4.3 billion cubic feet of natural gas pipelines.

NextEra Energy Partners' distribution growth has been impressive. It has increased its annual distribution by at least 15% since it went public in 2014. Moreover, the stock offers an attractive distribution yield of nearly 3.5% as of this writing.

NextEra Energy Partners looks to grow in three ways: through acquisitions from parent NextEra Energy, through third-party acquisitions, and via organic growth. In addition to asset dropdowns, NextEra Energy Partners benefits from the experienced management and deep expertise of parent NextEra Energy.

NextEra Energy Partners expects that the growth opportunities will allow it to provide 12% to 15% average annual growth in its distribution through 2025. The company posted solid performance in the second quarter, increasing its adjusted EBITDA 43% year over year. The growth was primarily driven by contributions from new projects.

Overall, you can expect solid total returns from NextEra Energy Partners in the coming decade. What's more, the company should have further growth opportunities beyond that, making it a smart stock to hold a decade from now.