Opportunity cost refers to the value of what you have to give up ( forgo ) in order to choose something else.
Opportunit cost helps you determine what you stand to lose by picking either option.
Formula to calculate opportunity cost.

FO – Return on best forgone option.
CO – Return on chosen option.
Example:
Chris has $15,000 worth of stock he can sell now for $20,000. He wanted to wait two months because the stock’s worth was expected to increase to $30,000. He decides to sell now . Calculate the opportunity cost.
Therefore, opportunity cost will be the difference between the $20,000 and the price he would have gotten if he sold the stock in two months time.

Therefore, the opportunity cost is $ 10,000.