How to get a custom attribute directly by name without product id?

How to filter an EAV or a flat collection (product, category, sales, etc.) with the addAttributeToFilter() method?