Try to buy from someplace reputable, as there is a lot of counterfeiting going on, just read a story on this a couple of days ago, but can't find it.
Also, while I never had a bad card, I read one person's viewpoint on brands (which I also can't find after 15 minutes of searching), laying out three tiers of manufacturers. I can't remember all of the brands, but do recall that Sandisk was top tier, and I think also Transcend and Lexar. Maybe Kingston, too. A-Data and PNY 2nd tier, RiData third tier. Who knows if this person was talking out of his hat or not?
I've had Lexar and Kingston and Sony (Memory Stick) in constant daily use, also have had A-Data and PNY for a long time and all have been very reliable. All mine have been properly packaged, and bought in stores or sent from a U.S. address.