To compute opportunity cost, first identify potential alternatives to your chosen option. Assign a monetary value to each alternative and subtract it from the value of your chosen option. This will provide you with the opportunity cost. For example, if you choose to spend $100 on A instead of B, and B is worth $120, your opportunity cost is $20.