Rather than focus on brand, I'd recommend developing a better eye and learning how to identify durable, high quality fabrics.
While looking at the brand might be a good heuristic to rely on in the short term, the temptation is too high for vendors to take advantage of their brand power to offload cheaper fabrics for higher margins, I'm looking at you H&M and UNIQLO ...
Along these lines, watch these two videos from Bernadette Banner to learn how to identify fabric types and learn how to identify quality features in clothing:
And this where the (independent!) physical store shines. I wish we had more discerning tradesmen these days. Something important went with the brick and mortar stores.
Some of these exist now in the form of (maybe) physical store (or online-only) plus youtube personality, of course.
I went through an Uniqlo last month and was very disappointed at how just about every sort of basic article of clothing I was looking for was at least 30% polyester. Polyester has its place, the fact its not breathable and cheap does make it genuinely useful in moderation to help warm certain articles, but I don't want it in every single basic t shirt and pair of pants.
You can still get high quality or at the very least 100% Cotton clothes there but you'll have to seek them out and they know people will pay a premium for them so they tend to be 2x or more the price of the popular Airism t shirts for example.
I did give up entirely on trying to find outerwear there that was at least roughly >80% organic materials like cotton or wool which was probably my biggest disappointment. You can find nice basics with good quality fabrics at many brands. But Uniqlo 10 years ago was my favorite for wintertime because they're one of the few that had affordable coats and outerwear that made use of real wool + down with good quality lining, excellent heat-tech jackets that used a great blend of breathable fabric + artificial ones to keep you warm but not sweating. I've worn an Uniqlo duffel coat, peacoat, and several jackets every year for the better part of a decade and they still hold up excellent besides some pilling on the coats that I haven't fixed yet.
They don't even really seem to carry proper coats anymore in their stores nor decent jackets, everything seems like the cheap polyester fleeces and puffer coats that everyone else has.
It's even more complicated. Many brands don't manufacture their own products. Or only manufacture some of them. They license to many manufacturers, typically. The same manufacturer may make the same or similar products for multiple brands too, even further complicating things.
As you've said, you really can't judge by the brand.
H&M is awful, but Uniqlo has some great products that will last. I’m a big fan of a few of their t-shirts, especially the heavy cotton tees. You really gotta get your hands on each product to know what’s worth the money though.