plugin – magento 2 hide out of stock products except when a specific attribute equals yes

I would like to hide out of stock products generally so I’ve added the option in the store configuration settings. However there are certain products that will be restocked soon. I’d like to keep showing those.

Therefore I decided to add an attribute to them to mark them for restock att_restock.

However I’m not sure how to override the logic so that it works in the category, layered navigation and search results pages now. I’ve tried other solutions in

Where should I add my plugin in order to add my logic in the selection?

Any help is appreciated.