Approve this mac using another device
Do you have an iPhone or iPad? If yes, then one of these can be used to receive the code. A PC won't work as I know.

If you still don't receive the code on your iDevices, try the following on your iPhone or iPad:


Go to Settings > Your Name (Apple ID, iCloud, iTunes &amp; App Store) > Password &amp; Security.
Enter your Apple ID password when asked.
Tap Get Verification Code


This might only work with Keychain enabled on your iDevice.

If you don't have any other Apple devices, it could be your last option to reset the iCloud Keychain. But in this case I'd prefer to call the official Apple Support.