The first precaution to take is always look for reliable vendors, and preferably, look for the official shops in major sales portals. Another care is always check the packaging and compare with photos and official reviews. As a rule, counterfeit packaging do not have as much quality as the original, so they tend to be more fragile or looser.
Another tip is to use some programs that perform function tests or check the manufacturer's information. Thus, you can check on the brand's website if the information is correct and if your card is original.