Choose stores that use secure websites. Examine the details of any online store you're not familiar with. Insist on using secure payment services (PayPal, credit card, etc.) Learn the warning signs of a fraudulent email or social media advertisement. Always check the shipping costs and conditions.
As long as you haven't acted fraudulently or negligently, your card issuer will usually refund your money if a criminal uses your online card details to commit fraud.