When you buy an option, you will pay cash up front, and for your transaction to be profitable usually you will need the stock to move in your direction. Option buyers are purchasing the opportunity to take an action on a stock, but are never obligated to make any moves. Once an option is purchased, the holder is never on the hook for more money. Option buyers are not required to own the underlying stock in order to buy an option.
If a stock moves up for the call holder, down for the put holder, the option should gain value, and will usually be able to be sold or exercised for a profit. To close this kind of position, simply sell the option you bought or exercise your option if you prefer.
When the option expires, the holder no longer has the opportunity to exercise it. If the option never becomes profitable, the buyer may be able to minimize losses by closing the position before expiration, or the option will simply expire and the holder will have a loss of the original contract price.