Get uBlock Origin from the Firefox add-ons site. That’s about it.

Some other extensions technically work for most of the random adtech, but the most important ads to block are the ones on Google Search (where the FBI warns that you are likely to click on a fraudulent ad) and YouTube.

Every once in a while YouTube tries some anti-adblocker trick, but you can check the uBlock Origin subreddit for status updates. Usually they fix it pretty quickly.

Firefox also has some built-in advertising features, which can be turned off.

And you can test how well you are protected using Cover Your Tracks from EFF.

More info

uBlock Origin works best on Firefox