How to cut out advertisements from web pages which use random names for id and classes

This short article is about custom rules for uBlock Origin that (yet) could be used to remove commercials from web pages even if the page uses random generated element ids and css classes. Basic knowledge of html/css required.