If you're investing for the long term, you don't need to worry about what's happening in the markets right now. While there will be downturns over a long investing period, in the long haul, you can come out far ahead by targeting high-growth areas. A couple of the most promising industries to invest in right now are cannabis and 5G technology. Here's why you should consider these emerging opportunities and how to gain exposure to them.

1. Cannabis

The cannabis industry is a challenging one to forecast because of the uncertainty surrounding legalization. Although dozens of states permit medical use and big names like New York and New Jersey have recently passed legislation for recreational use, marijuana remains banned at the federal level. However, globally, more countries are permitting use as well. Germany, for instance, is a country to watch as it may legalize recreational use within the next year

Earlier this year, Fortune Business Insights released its projections for the global cannabis market. It expects the industry will jump from $28.3 billion in 2021 to nearly $198 billion by 2028. That averages out to a compound annual growth rate (CAGR) of 32%. There are certain subsectors that are growing at even higher rates; Grand View Researchers project a CAGR of more than 104% for the global cannabis pharmaceuticals market. 

There are multiple ways for investors to take advantage of these opportunities. One is to buy individual cannabis stocks, but an even easier option is to invest in an exchange-traded fund (ETF) that offers broader diversification. The AdvisorShares Pure US Cannabis ETF (MSOS -1.73%) invests in the top multistate marijuana operators in the U.S. This includes top cannabis producers such as Green Thumb IndustriesTrulieve Cannabis, and Curaleaf Holdings. Unfortunately, year to date, the fund has lost more than half of its value, which is far worse than the S&P 500 (it's down a more modest 16%).

But if you're in it for the long term, the potential upside could be well worth it. Cannabis stocks are down right now as there hasn't been much reason for excitement about it (i.e., no progress on federal legalization in the U.S.). However, if that changes, pot stocks could quickly become scorching-hot buys again.

2. 5G

A less risky growth opportunity than cannabis is 5G; there are no concerns about legality here. It represents the next wave of cellular technology, promising consumers even faster internet connectivity. It's still a growing sector as telecom companies expand their networks and 5G phones become more prevalent. As of December, approximately 60% of phones in the U.S. had 5G capabilities. 

The potential goes beyond just telecom companies creating greater revenue streams and offering new plans. Some of the biggest benefactors will be companies offering cloud computing or next-gen technologies such as artificial intelligence, where having increased bandwidth and faster download speeds can be essential to providing an enjoyable experience for the end user. For this industry, Fortune Business Insights projects that the CAGR will be 71%, hitting a value of more than $80 billion by 2027.

This is a much broader array of businesses that you'll need to consider than with cannabis, where the focus will primarily be on marijuana-producing companies. An ETF that can help you with this is the Defiance 5G Next Gen Connectivity ETF (FIVG -1.31%). Among its top holdings are telecom company T-Mobile US, chipmaker Advanced Micro Devices, and real estate investment trust American Tower.

The 5G Next Gen ETF is down 20% this year as tech stocks, in general, haven't fared too well of late. But for long-term investors, investing in 5G while valuations are low could lead to great returns in the future.