It is printed on a slip of paper inside the game case.
If the case has lost its insert, that is usually the end of the road — the code is not tied to your account and cannot be reissued. Second-hand copies without the paper frequently cannot be activated, which is worth checking before you buy one.