Hi chenbrick
I am Dave, I will help you with this.
Most likely, that is a phishing scam Email, not sent from Microsoft, even though it may look like it is sent from Microsoft, if you did not request a code, then you can safely ignore and delete that Email.
If you like, as an extra precaution, you should log into your Microsoft Account in a web browser and change your Microsoft Account password. Please Note, that would mean that everywhere you use your Microsoft Account, the password would have changed