My rule is to never buy the cheapest thing, because to a point, you get what you pay for. But my other rule is not to spend extra for brand recognition or supposed higher quality. There's a middle range where you get reasonable value, better-than-crap stuff. Too low and you're buying junk, too high and you're overpaying, perhaps for brand or reputation, for something you can get elsewhere for less.
Agree with the sibling reply--clothing in particular this paradigm is dead, but it's dying out in general, too. I'm frequently finding myself with mid-range products of barely better quality than the bargain basement.
This has been the wisdom for a long time but in some areas, clothing especially, it has finally fallen apart.
Currently with clothes the cheapest are arguably good value, you get shit but at cheap prices. And high end you at least get good materials: it may not be "worth it" but if you want high quality fabric, which is extremely real, this is what you're paying. The midrange is the worst of both, quality barely if at all higher than the bottom level, but prices significantly higher.
This is too complicated to approach by looking at brands too. Accounting for diffusion lines, subbranding, white labeling etc there are almost no companies that make only bad or only good quality, and the quality is not very well correlated to price or brand prestige either.
For clothing there are currently very few general value signals that are still working, a huge contrast to 10 but even 5 years ago.
The problem with that strategy is that, used at scale like it is, it just creates a perverse incentive to raise the prices on your crappy product, without changing anything else.
For example, in the liquor market, there are basically 4 price points for 750ml bottles: $20 and below is generally swill, but it's cheap swill. Companies here are competing on price. $40-60 gets you something worth drinking, but perhaps not prestigious. Companies here are competing on quality. $100 gets you something prestigious, and companies are competing on such, and the $200+ price point gets you something rare.
If I buy a $30 dollar bottle, in a sane world it would be something with a middling tradeoff between price and quality. Instead what you get is something that is as bad, if not worse, than the $20 stuff, because the company is simultaneously failing to compete on price AND on quality. That leaves them in the hail-mary zone of hoping to offload their product on uninformed buyers, who typically would be in $20 range, but think they're splurging on something a little nicer.
Same principle goes for consumer electronics, like headphones. There's the $20-ish range of cheap stuff, there's the >$100 range of good stuff (though less cleanly sorted than liquor, probably because people buy a lot more bottles over time than they do headphones), and no-mans land of $50 which suck and cost twice as much as the $20 pairs.