If you want to invest without any risk, then the stock market isn't for you. Despite the market's inherent risks, it's still an important piece of the best financial plans. You just need to understand the most important threats involved with investing and set yourself up to safely avoid them. These four risks aren't the only ones that you'll encounter, but they are important considerations for building a sound investment plan.

1. Company risk

Company-specific risk is probably the most prevalent threat to investors who purchase individual stocks. You can lose money if you own shares in a company that fails to produce enough revenue or profits.

Poor operational performance can cause a company's value to drop in the market. In some cases, a company can report great sales and profit figures, but its growth or outlook isn't strong enough to meet overly optimistic investor expectations. In the most extreme circumstances, companies can completely collapse, resulting in the total loss of any capital invested. Enron investors can attest to this.

You can reduce company risk by doing your homework. Analyze quarterly earnings results, listen to management commentary on those results, and measure performance with different financial ratios. Read commentary from analysts, competitors, suppliers, customers, and other investors. Make sure that a stock's valuation makes sense based on its potential profits.

Unfortunately, all the homework in the world won't turn you into a psychic. You can't know what the future holds. Diversification is the only way to effectively eliminate company-specific risk. Consider buying other stocks in the industry -- or stocks across a number of industries -- just in case things don't go to plan. The more your own, the more you dilute the risk posed by any single stock. Mutual funds and ETFs are great tools for this purpose.

Person holding up a post-it note that says "risk."

Image source: Getty Images

2. Volatility and market risk

No matter how well a company performs, its stock is still subject to volatility and market risk. Stock prices are determined by supply and demand, like anything else. If people are pulling capital out of the stock market in general, then stock prices are going to fall.

Market crashes are bound to strike on occasion, but history tells us that they're only temporary. The key here is to prepare yourself emotionally and position your portfolio to avoid the biggest drops. If you avoid selling when the market is down, then you'll never realize the losses. Holding on through a downturn keeps you in a position to reap returns when the market returns to growth. Make sure that you have a source of cash outside of your investment portfolio to cover unexpected expenses or opportunities.

You can also build a portfolio to limit volatility. Once again, diversifying the types of stocks you own can help. Defensive stocks and dividend payers tend to experience less volatility than growth stocks. Investors with short time horizons should also keep some of their assets in bonds, cash, CDs, or money market accounts. These aren't as volatile as stocks.

3. Opportunity cost

We can think about this as the risk of missing out. Opportunity cost refers to gains you could have attained by choosing a different investment. If I buy stock A, and it grows 10%, but stock B grew 15% in the same time frame, then my net opportunity cost was that 5% difference.

If you don't put yourself in a position to achieve responsible investment growth, then you risk leaving money on the table. As we covered above, you can't just go all-out for investment growth, especially if you're approaching retirement. Still, you'll want to minimize the risks associated with opportunity cost by allocating at least some of your portfolio to growth stocks. This is especially relevant for young investors saving for retirement with 401(k) or Roth IRA accounts. To determine how much of your portfolio should be allocated for growth, use a risk tolerance questionnaire.

4. Liquidity risk

Liquidity risk doesn't get a lot of attention, but it's important and intuitive. Liquidity refers to the ease with which an asset can be exchanged for another (usually how fast it can be sold for cash). Cash is the most liquid asset. Stocks and bonds are also usually considered highly liquid. Real estate and private business ownership are on the other end of the spectrum. It can take months or years to sell those assets. Illiquid assets are difficult to unload to realize gains or cover unexpected cash needs.

While most stocks and ETFs are highly liquid, they aren't all equal. Thinly traded equities, such as penny stocks, unpopular ETFs, or certain small-cap stocks can present some issues. You might incur higher costs to trade these securities, with high bid-ask spreads, for example. You should also consider functional liquidity across different account types. Assets held in qualified retirement accounts, such as a 401(k), might only be available to you after paying an early withdrawal penalty.

To manage liquidity risk, research daily trading volumes and the bid-ask spread for any stocks you want to buy. If you are going to hold illiquid investments, make sure you have enough liquidity elsewhere in your plan to meet your potential needs.