All decisions about spending scarce resources - such as time or money - are economic choices. Each option comes at the cost of missing out on the alternatives;
The opportunity cost of an option is the most valuable alternative.
Opportunity cost between two options is calculated by dividing the value of the opportunities.
For example, if a farmer can produce 100kg of potatoes or 80kg of carrots, the opportunity cost of producing carrots is
(80kg carrots)/(100kg potatoes). Producing .8kg of carrots carries an opportunity cost of 1kg of potatoes.
A producer that can produce more of a good or service than their competitors has an absolute advantage.
When one producer has a lower opportunity cost to produce a good than their competitors, they have a comparative advantage.
When a producer focuses production on a good or service where they have a comparative advantage, the producer increases their specialization.