Admin → Discounts. Pick “Amount off product” for most cases — not Buy X Get Y.
All-caps, short, no lookalike characters (0/O, 1/l). Test-typing it beats cleverness.
“All customers” leaks your margin to everyone; restrict to customer segments if the code is for a campaign.
Set “Limit number of times used” — one viral tweet with an uncapped 50% code is a bad afternoon.
Decide if it combines with shipping or other discounts. Add an item to cart and actually test the code.