TCG Live —> Shop —> Redeem, if you're referring to TCG codes.
In-game (main series), use the Mystery Gift—> Get via code.
Please specify if it's any other kind of code.