I just learned how to do some uBlock origin cosmetic selectors to remove elements on the page that invite me to use AI or take up screen real estate offering pointless AI summaries.
So many web sites use auto-generated CSS class names that you can't match on the actual classes. And you can't be sure that it will actually be 3 <div>s from the root or anything like that. 
What I really like is the :upward() selector. I can basically match something like <h3>Try our assistant</h3> and then append :upward(3) to tell uBlock that regardless of what their names are, block the entire div 3 levels up because I found the matching text down here.
One of the things I'm hiding is a graphical button, so I use its aria-label to match it.
Here's some examples:
example.com##.genaiPageSummaryButton:upward(8)
example.com##span:has-text("Open the Assistant"):upward(3)
example.com##a[aria-label="Open automated answers"]:upward(2)
