If you receive a code but didn't try to log in or change your password, someone else may be trying to access your account. You should secure your account immediately.
Depending on your security settings, you can get these codes through different channels: Fix common issues with 2-Step Verification - Google Help 6 digit verification code gmail
If you prefer not to rely on cellular networks, you can link your Gmail to an authenticator app (like Google Authenticator, Authy, or Microsoft Authenticator). These apps generate a new, valid 6-digit code every 30 seconds directly on your device, entirely offline. Common Issues: Why Am I Not Receiving My Code? If you receive a code but didn't try
Do you have (phone/computer) where you are still logged into this Gmail account? 6 digit verification code gmail