Your gamertag lives in the cloud (Xbox Live), not on the console. Here's the recovery process:
Use account.microsoft.com/recovery → follow recovery flow (alternate email, phone, authenticator, security questions).
Your gamertag is safe in the cloud. The console is just a terminal.