Opportunity cost is when someone has to sacrifice something for something else.
Ex: Someone who wants to buy shoes wouldn’t have the chance to buy a shirt if they bought the shoes.
So, it affects their wants and needs because if someone needs to do one thing, they cannot do the other. If someone wanted to go to a baseball game they wouldn’t be able to study, and they’ve got to pick which is more important.