Resources are assigned a value based on the cost of using an input to do one thing instead of another, this is called the opportunity cost. The opportunity cost of one action compared with another is determined by comparing the potential benefits of each action.
For example a petrochemical company might have a reserve of crude oil that they keep to cope with spikes in demand or short falls in supply. The opportunity cost of holding the crude oil out of the market is the value that the oil could be sold to another firm for. The decision the hold the oil in reserve is determined to be the better alternative because it protects the long-term supply of oil for that firm. Alternatively, the decision to sell all the oil immediately only provides some short-term profit and does not provide long-term security.
Likewise, if a student has a big exam coming up and takes a day off work to study then the opportunity cost of studying is the amount of money that would have been earned had they gone to their normal shift. Assume the shift is 8 hours long and the student is compensated at a rate of $16.25/hr, the opportunity cost of studying would be $130. Conversely if the student chooses to go to work as per usual instead of studying and get a B+ on their exam in which case the opportunity cost might be an A grade on their exam. In economics, this decision is called a trade-off, the student sacrifices $130 to get an A grade or sacrifices the A grade for the $130.
Now assume the student got the A and decided to celebrate with a trip to an exotic destination, the real cost of the vacation is both the money it costs to buy the vacation as well as the opportunity cost of taking two weeks off of work to go (assuming vacation is not paid). If the cost of the vacation is $2000 and two full work weeks yield $1300 then the real cost of the vacation is $3300. The student forgoes the money they could earn in the two weeks of work as a trade-off for some fun in the sun.