It is printed inside the disc case — which means you need to have bought the game. The code is a licence key tied to a legitimate copy, not something that exists independently of one.
If you own the disc but the case has been lost, the key is sometimes recorded in the packaging insert or in your order confirmation if you bought it digitally.