To opt is to choose. Given the alternative, most kids will opt for a cupcake over a ham sandwich.
When you're signing up for next semester's classes, you might opt for another history class, or instead opt for advanced biology. Whenever you have more than one alternative, you have the chance to opt for something. You can also opt out of something, or choose not to do it at all. Opt comes from the French verb opter, "to choose," from the Latin root optare, "desire," and it's related to option.