Be very careful here. Some answers floating around ask you to hand over your Xbox Live or PlayStation Network ID and password in exchange for a registration code, then claim you will be banned if you refuse.
That is a phishing attempt, plain and simple. No legitimate support channel needs your account password, and threats of a ban are there to frighten you into complying. Never share those details.
Your real registration code comes with the game itself — printed on the disc case, in the manual, or in the confirmation email for a digital purchase. If it is missing, contact the retailer or publisher's official support.