An opportunity cost is the value presented by an option that is forgone because a different choice is made.
Opportunity costs may be considered when it is necessary to choose between two or more mutually-exclusive options, such as deciding which of two projects to fund, whether to build or buy software, whether to use a cloud storage service or rely solely on your own infrastructure and private cloud storage, or whether to buy an existing business or launch a startup. Each option has potential benefits and costs; the benefits offered by a given option become an opportunity cost when the other option is chosen.
A cost-benefit analysis (CBA) of both options can yield more insight into which is the better route for the organization to take. To inform a build or buy decision, for example, opportunity costs should be considered along with the costs of developing or purchasing the system and maintaining it throughout its life cycle.
See a video tutorial on trade-offs and opportunity costs: