An unexpected code does not automatically prove that someone accessed your account. It can mean someone entered your details, mistyped their own number, or attempted account recovery.
Never forward or read the code to someone who contacts you.
Open the relevant service directly and review security alerts, active sessions, and recent activity.
If the activity is unfamiliar, change the password and enable multi-factor authentication.