Opportunity cost is the cost of an action associated with not being able to do the next best alternative. It typically comes into play when an agent must choose one action from a set of actions. When measuring the profits of an activity, it is sometimes useful to price in the forsaken benefits that could have been derived if the agent had used their resources for some other purpose.
Opportunity cost it a concept that the social sciences adopted from the field of economics. It takes into account the sacrifice of one's time, capital, and other resources that were expended in order to achieve a possible outcome.