Scarcity is the situation when there are unlimited wants and limited resources
Example: A boy has $10 and he wants to buy a pen and a pencil. The cost of the pen is $8 and the cost of pencil is $6. The situation clearly shows that he cannot buy both the things because it will cost him $14 to buy the both things, and he has only $10.
We will have to make a choice because of scarcity.
Example: As he can buy both the things he will have to make a choice. He will have to choose between pen and pencil.
Opportunity cost is the best alternate forgone
Example: If the boy decides to buy a pen the opportunity cost of buying a pen will be the pencil.
If the boy decides to buy a pencil the opportunity cost of buying a pencil will be the pen