Your best bet is to buy from big online stores with easy returns (Amazon, Mediamarkt, Fnac, or wherever you are) because if the cable fails or is counterfeit, you're guaranteed the right to claim a refund. In physical stores, shopping malls are a lottery because anyone sells there without real oversight.
As for brands, you don't need to go for the most expensive ones. Belkin, AmazonBasics, and even decent generic brands from big stores work fine if you buy them from a real place. What works is looking for certified HDMI 2.0 or 2.1 cables (check the description) and avoiding the ones that cost less than two euros, because those tend to be counterfeit. When you buy online, read the reviews and see if people complain about the connector loosening or it not working with certain devices.
If you insist on buying from a physical store, at least make it a big one with a reputation where you know there's actual warranty. HDMI cables are rare to fail if they're decent, so if you buy one at a mid-range price from a known store, it'll probably last you years without issues.