Energy is a highly cyclical sector, often going through swift and dramatic price spikes and declines. Today oil prices are high and investors are excited about energy stocks. That means if you are buying an energy stock today you need to think about what happens when the next downturn comes. Here are two energy names you might want to buy and one that you should be worried about.

Steady as she goes

North American midstream giant Enbridge (ENB 0.68%) owns a portfolio of oil and natural gas pipelines. Combined they make up 84% of the company's earnings before interest, taxes, depreciation, and amortization (EBITDA). These assets are largely fee based, so Enbridge is paid for the use of its pipelines and the often volatile price of the commodities it transports aren't all that important to it. As such, its cash flows tend to be fairly resilient to energy price swings. 

In addition to that, the company also operates a natural gas utility (12% of EBITDA). This business is also fee based, but benefits from government regulation that puts it even further outside the energy industry's ups and downs. But the real star today is the 4% of EBITDA that comes from the company's clean energy investments. That 4% is tiny today, but the company is investing heavily in this business line because the world is shifting toward a cleaner future. It is, basically, changing with the times using the strong cash flows from its carbon businesses to fund the effort. 

Meanwhile, investors get to collect a fat 6.7% dividend yield backed by 27 years of annual dividend hikes. (Note that the dividend is paid in Canadian dollars and the payment U.S. investors receive will fluctuate with currency translation rates.) All of that said, Enbridge's business is designed to throw off reliable cash dividends -- it is not a way to directly benefit from rising energy prices.

On a similar path

The top and bottom lines of integrated energy giant TotalEnergies (TTE -0.32%) are tied directly to oil and natural gas prices. That means that investors need to be prepared for the company's business performance to be volatile. However, if you are looking to take advantage of today's high oil prices, that direct energy exposure will probably be something you find appealing. And yet what about the future? TotalEnergies, like Enbridge, is building out a clean energy business that should help to smooth out revenues over time and allow it to remain an important energy company even as oil demand wanes over the very long term. It is using today's high energy prices to help fund the shift, with a series of notable acquisitions over the past year or so.

Only the path here is important. TotalEnergies isn't looking to abandon its carbon fuel past. In fact, it wants to invest in clean energy and grow its exposure to natural gas (which is seen as a transition fuel) all while it shrinks its exposure to oil. The current supply/demand imbalance in the energy sector shows that this is a prudent call since an "all of the above" strategy is the most likely future. This is, to some degree, a middle ground approach for conservative investors not willing to take on the risk of an all-or-none strategy. TotalEnergies, meanwhile, offers a generous 5.4% yield (U.S. investors will have to pay French taxes on the dividends).

Playing with (a little) fire

BP (BP 0.13%) competes directly with TotalEnergies and is also working on shifting its business toward the clean energy future. Only there's a material difference here that investors need to understand. TotalEnergies' debt-to-equity ratio is roughly 0.55 times while BP's is a much higher 0.95 times. Leverage tends to enhance performance during good times, but it can become a major headwind during difficult times. And since the energy sector is prone to swinging between the two, most investors will probably want to avoid BP in favor of peers like TotalEnergies. 

Notably, BP cut its dividend in 2020 as it announced its plans to shift in a cleaner direction because it needed to free up cash. TotalEnergies, on the other hand, not only announced that it would maintain its dividend, but it increased it 5% in 2022. Sure, BP has started to increase its dividend again, but for most investors that cut should be a warning sign that the company doesn't have as strong a financial foundation as TotalEnergies.

Invest carefully

The energy sector is volatile and you need to keep that in mind with oil and natural gas prices at elevated levels. Nobody knows when the market will turn lower, and it could continue to head higher, but a downturn is something that you should at least consider as a possibility. Enbridge allows you to sidestep much of the commodity volatility with a company that's also looking to adjust with the changing energy landscape. TotalEnergies provides direct exposure to oil and natural gas, if that's what you are after, while hedging your bet with clean energy investments and a relatively strong balance sheet. Both are pretty good options today, especially for dividend investors.

BP, on the other hand, has a lot of leverage and while it is doing well right now thanks to high energy prices, a downturn could change that situation very quickly. Most investors will probably want to avoid it.