Simply put, opportunity cost is the loss you incur for choosing something because of other alternatives.
Now, if you choose to go to the Katy Perry concert, the ticket costs $140. But you aren't paying because you got it for free!
On the other hand, if you don't go, you can word on a project at $31 per hour for 3 hours, that would give you:
31 * 3 = $93
Thus, you can earn a potential $93 by not going to the concert. If you choose to go to the concert, you are forgoing the potential of earning $93!
Thus, we can say:
The opportunity cost of going to the Katy Perry concert is $93