A code you did not request can mean someone entered your number by mistake or is trying to register it on another phone. The code alone does not mean they succeeded. Do not forward it to a friend, caller or supposed support agent.
Check your account
- If WhatsApp still opens normally, ignore the unsolicited code. Check Settings → Linked devices for sessions you do not recognize and log those out.
- Turn on two-step verification and add a recovery email you control. Keep your phone and email accounts protected too.
- If WhatsApp says your number was registered on another phone, follow WhatsApp's official account-recovery instructions from its app or Help Center. Alert close contacts if someone sent messages pretending to be you.