If you're considering investing in the energy sector, it is hard to avoid the concerns around the shift from carbon fuels to cleaner alternatives like solar and wind power. You do need to take into account the transition that is taking place, but the important takeaway is that it is a slow-moving change.

That's why energy companies like Enbridge (ENB -0.22%) and TotalEnergies (TTE 0.32%), with their feet still firmly in the carbon energy world, are two great dividend stocks to consider buying today.

The clean energy shift is real

Clean energy is not a fad; it is a very real threat to older, dirtier energy sources. For example, coal use in the United States has plummeted as the use of cleaner natural gas has increased. Solar and wind power are also spreading rapidly. However, solar and wind are building off of a very small base, so the growth rates are high, but they still have room to increase as a percentage of the overall energy pie.

An oil well with clean energy wind turbines in the background.

Image source: Getty Images.

This leaves dividend investors with a bit of a conundrum. Energy companies that produce oil and natural gas are still generating huge cash flows and will likely continue to do so for decades to come. But the long-term future is probably going to include significant amounts of clean energy, too. Luckily, you don't have to buy oil or clean energy stocks; there are options that allow you to benefit from the cash flow created by oil and natural gas today while still giving you exposure to clean energy.

Enbridge is a slow-and-steady tortoise

Enbridge is one of the largest midstream companies in North America. It owns a portfolio of pipelines, storage, and transportation assets that would be difficult -- if not impossible -- to replace. It charges fees for the use of this vital energy infrastructure, so it has reliable cash flows throughout the energy cycle. This is how it supports its huge 7.7% dividend yield. Furthermore, the dividend has been increased annually for 29 consecutive years. The company's oil and natural gas pipelines make up around 85% of earnings before interest, taxes, depreciation, and amortization (EBITDA).

The rest of the business consists of a natural gas utility and clean energy investments, like offshore wind farms in Europe. Natural gas is considered a transition fuel and is cleaner burning than coal or oil. Enbridge is in the process of buying three additional natural gas utility operations, which will reduce the pipeline segment's contribution to EBITDA to 75%. And it continues to invest in clean energy, which only accounts for about 3% of EBITDA but should continue to grow in importance over time.

Enbridge is trying to evolve with the world around it so it remains an important provider of energy, in whatever form it takes. That should be music to the ears of long-term investors looking for a high-yield stock. The only caveat is that the yield here is likely to make up the lion's share of your return. But if you are trying to maximize the income your portfolio generates, that probably won't be an issue for you.

TotalEnergies is pushing hard into a new space

If you want more direct exposure to the ups and downs of oil prices, which are currently heading higher, you might want to consider TotalEnergies. Given that it produces oil and natural gas, it will benefit from rising energy prices (it will also bear the brunt of falling prices). But it is an integrated energy major, which means it has a globally diversified business that is spread across the upstream (production), the midstream (pipelines), and the downstream (chemicals and refining). That diversification helps to soften the peaks and valleys in the highly cyclical energy sector.

What sets TotalEnergies apart from its peers is that it has made a major commitment to investing in clean energy and electricity. These are increasingly important areas of the broader energy sector as the world moves in a greener direction. So, like Enbridge, TotalEnergies is looking to adapt with the times. And there's one more important fact: When peers BP (BP 0.08%) and Shell (SHEL 0.36%) announced similar strategic shifts at the turn of the decade, they cut their dividends. TotalEnergies supported its payout, highlighting that it understood how important the dividend was to shareholders.

The company's clean energy and electricity business is still modest in size, at about 7% of total segment net operating income. But TotalEnergies is evolving in a responsible way by using the cash flows from its carbon energy operations to both build that investment and to pay its reliable 4.4% dividend yield. That's a good balance for those seeking long-term exposure to energy commodities and a hedge against the clean energy transition.

Two ways to collect big energy yields for years to come

Investing is always a balancing act between risk and reward. When it comes to the energy sector, the biggest long-term threat is the ongoing, though slow, progression to cleaner energy sources. But you can have the best of both worlds if you invest in Enbridge and TotalEnergies. The two companies generate reliable cash flows from their carbon-heavy businesses, supporting their dividends and investments in the future, which increasingly include more clean energy.