Opportunity cost, to put it as simply as possible, is the price you have to pay in order to obtain something else. It is what you lose, to gain something else.
Opportunity cost is a result of scarcity. We are not living in a fairy tale where everything is magically abundant and we have infinite resources. Therefore, scarcity and managing our finite sources is a vital gear of the economic machine.
You work, you earn money. What happens here? You lose some hours of your life, which you could spent on anything else like studying, reading a book, hanging out with friends or some alone time. In return, you gain money so that you will be able to use that money to purchase items and products that you desire.
Lilian, a young accountant and also a techno fan, earns 50$ an hour. One night, she decides to leave two hours early in order to attend a live set of her favorite artist with her friends. The ticket costs about 80$. What is the opportunity cost here? She has worked two hours less, which makes it 100$, and has also paid 80$ for the ticket, hence the opportunity cost of her leaving the work and watching her favorite artist perform equals to 180$.