The first answer explains it all as well but just to be clear,
1. Opportunity Cost.
For example, you didn't buy the dress, but instead bought a new laptop. The opportunity cost is the amount of time / hours you used the laptop to play games or to do whatever.
2. Scarcity.
Lets say you don't have enough money for some sneakers but you also want to buy something you have enough money for. Would you save or buy the other item?
~Pooch ♥