Contact Steam Support with the code and a screenshot of the error. That's the only route that actually resolves it.
Before you do, rule out the obvious: check for a typo, confirm the code hasn't already been redeemed on your account, and make sure it matches the region it was sold in. If it came from a third-party seller, keep the receipt — support will ask.