If you don't know how to invest in oil without hitting a dry well, you may need to dig a little deeper into the oil market.

One of the biggest reasons to consider investing in oil is the recent performance of stock prices. Shares have soared in the beginning of 2018 and are almost double what they were at this time in 2016. Oil share prices had dipped more recently as U.S. shale production has increased, but there are ways to invest in oil that can make the most of the market's volatility. If oil company shares dive with the rest of the market, oil investing will offer a lot of room for growth down the line.

Supply keeps increasing, which will ultimately bring prices down before they rebound again. Given the oil commodity's natural cycle, it's best to buy when oil barrel prices are lower. If you know how to buy when oil prices are low, it is much easier to invest in a commodity that just about all of us use regularly. So how do you get started?

1. Buy oil stocks and energy stocks

Oil prices have a direct effect on the value of Halliburton (HAL) , ExxonMobil (XOM) and BP (BP) shares, and investing in well-known oil stocks will let you know if the oil industry and related energy industries are the right fit for you. Take a look around, see how much debt oil and energy companies are carrying, how much profit they're generating and how much they're paying investors in dividends.

2. Buy oil futures

This is one of the riskiest ways to invest in oil commodities, but it beats maintaining hangars filled with oil barrels.

Oil commodity futures are incredibly volatile and can involve a lot of capital up front. Investors who aren't accustomed to doing in-depth research and taking substantial losses should approach with caution. If you're ready, however, oil futures can be found on the New York Mercantile Exchange, among other commodities exchanges. If you buy into an oil futures contract and the price of that oil goes up before the contract runs out, those oil futures can be a lucrative investment. But that is where the risk in oil investing lies.

Folks who invest in oil futures regularly -- heating oil contractors, fuel oil suppliers, even airlines -- tend to know what oil typically costs throughout the year and when to buy it. The average investor may not have similar familiarity with oil commodity pricing and patterns. Only approach this particular oil investment if you've done significant research or have an adviser who's familiar with oil futures.

3. Buy into a master limited partnership

The master limited partnership, or MLP, has a lot of potential for stable cash flow, big capital gains and high yields. It also has a whole lot of complexity.

It takes a seasoned oil or energy investor to parse out their structure and report their gains and losses (which can be significant) to the Internal Revenue Service. However, the general parters who run the funds and the limited parters who do little but sit and wait have shared interests in the fund's success, and the limited-partner shares the partnership sells shields investors from the worst of it.

Back in January, InvestorPlace recommended Marathon Petroleum's (MPC) master limited partnership (MPLX) , as well as Western Gas Partners (WES) , Enterprise Product Partners (EPD) and EQT Midstream Partners (EQT) . Checking into those or other oil and energy MLPs will give investors some idea of what they're getting into, who their partners are and how much risk is involved.

4. Buy oil and energy ETFs

For a casual investor, an oil commodity exchange-traded fund or mutual fund is the simplest and least-scary way to start investing in oil.

Consider that a fund pegged to the S&P 500 already has more than 5% of its investments dedicated to oil and energy companies. An oil ETF or oil mutual fund can combine oil company stocks and oil futures into one fund that diversifies your holdings and doesn't require you to thumb through every oil or energy company looking for winners. ETFs trade on exchanges just like stocks, but a share of the U.S. Oil Fund (USO)  is basically the equivalent of a barrel of oil. Energy-sector ETFs, like the iShares Global Energy Sector Index Fund (IXC) , and energy-sector mutual funds, like the the T. Rowe Price New Era Fund (PRNEX) , minimize risk while investing fully in oil and energy.

If you have even basic knowledge of the oil industry, you can look into the holdings within an oil ETF and see if they're right for you. Just realize that oil ETFs can vary widely. Some invest in oil futures rather than oil- and energy-company stocks, which means they view the oil market and oil prices differently. Some don't offer dividends, while others will flounder even as oil prices rise.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.

More from Investing

Bitcoin History: Timeline, Origins and Founder

Bitcoin History: Timeline, Origins and Founder

J.C. Penney Bond Market Moves Hint Department Store Retailer Is on Life Support

J.C. Penney Bond Market Moves Hint Department Store Retailer Is on Life Support

Worried the Bull Market Is Over? First Grab Some Late Cycle Buying Opportunities

Worried the Bull Market Is Over? First Grab Some Late Cycle Buying Opportunities

Use Extreme Caution as Tesla's Stock Breaks Below This Key Price

Use Extreme Caution as Tesla's Stock Breaks Below This Key Price

What Is Warren Buffett's Net Worth?

What Is Warren Buffett's Net Worth?