Losses in the stock market come in different forms, and each of these types of losses can be painful, but you can mitigate the sting with the right mindset and a willingness to learn from the situation.

Capital Losses

This form of loss is the simplest and perhaps most painful: You buy a stock then watch the price go down and stay down. You decide to end the pain and sell it at some point. This kind of loss is referred to as a capital loss because the price at which you sold a capital asset was less than the cost of purchasing it. You can use a capital loss to offset a capital gain (a profit from selling a capital asset) for tax purposes. A capital loss or gain is characterized as short-term if you owned the asset for one year or less. The loss or gain is considered to be long-term if you owned the asset for more than one year.

Opportunity Losses

Another type of loss is somewhat less painful and harder to quantify, but still very real. You might have bought $10,000 of a hot growth stock, and the stock is very close to what you paid for it one year later, after some ups and downs. You might be tempted to tell yourself, “Well, at least I didn’t lose anything.” But that’s not true. You tied up $10,000 of your money for a year and you received nothing in return. You would have earned at least a little bit of interest during that same year if you had stashed your money elsewhere, such as in a certificate of deposit (CD) instead. This is known as an opportunity loss or opportunity cost. You’ve experienced an opportunity loss when a stock goes nowhere or doesn’t even match the lower-risk return of a bond. You’ve given up the chance to have made more money by putting your money in a different investment. It’s basically a trade-off that caused you to lose out on the other opportunity.

Missed Profit Losses

This type of loss results when you watch a stock make a significant run-up then fall back, something that can easily happen with more volatile stocks. Not many people are successful at calling the top or bottom of a market or an individual stock. You might feel that the money you could have made is lost money—money you would have had if you had just sold at the top. Many investors sit tight and hope the stock will recover and regain the high, but that might never happen. Some investors may be tempted to hold on again if it does, hoping for even greater profits, only to see the stock stage another retreat. The best cure for this type of loss is to have an exit strategy in place—and to be happy with a reasonable profit.

Paper Losses

You can tell yourself, “If I don’t sell, I haven’t lost anything,” or “Your loss is only a paper loss.” While it’s only a loss on paper and not in your pocket (yet), the reality is that you should decide what to do about it if your investment in a stock has taken a major hit. It might be a fine time to add to your holdings if you believe that the company’s long-term prospects are still good and you’re a value investor. On the other hand, your paper loss will become an opportunity loss if the stock continues to underperform.

How To Deal With Your Losses

No one wants to suffer a loss of any kind, but the best course of action is often to cut your losses and move on to the next trade. Turn it into a learning experience that can help you going forward:

Analyze your choices. Review the decisions you made with new eyes after some time has passed. What would you have done differently in hindsight, and why? Would you have lost less or perhaps nothing at all if you had acted differently? Answering those questions may help you avoid making the same mistake twice.Recoup what you lost. Tighten your financial belt for a while if you must. You might be able to recoup it with a little discipline if the loss is small enough. Regain that money and try again, keeping in mind the things you learned for the next time the market gets shaky.Don’t let losses define you. Keep the loss in context and don’t take it personally. Remind yourself that a lot of other people out there took a hit just like you did—perhaps even more of a hit than you did. The loss doesn’t define you, but it can make you a better investor if you handle it correctly.