You choose what people might search for, write a short ad, and pay Google when someone clicks it. The ad is shown only when a search matches, and you set a budget so the cost stays under your control.
What do I actually pay for?
In the most common setup you pay when someone clicks your ad, not when it is shown. How much each click costs depends on competition for that search.
How do I know it is working?
Set up conversion tracking so Google counts the calls, forms or sales that follow a click. Then compare what you spent with what you got.
What goes wrong most often?
Paying for searches that do not match what you sell, sending visitors to a page that does not match the ad, and never checking the numbers. Each of these has a plain checklist on this site.
Do I have to do all this myself?
No: you can hire a freelancer or agency, or use software that drafts fixes for you to approve. Either way, keep the account in your own name and set a spending limit.