Thanks for asking the Apple Support Communities for help with two-factor authentication. Please review the following help article as it has many options, and ways to verify your trusted devices: Two-factor authentication for Apple ID
It also has a section to help if you do not receive the code as stated here:
What if I don’t have access to a trusted device or didn't receive a verification code?
If you're signing in and don’t have a trusted device handy that can display verification codes, you can have a code sent to your trusted phone number via text message or an automated phone call instead. Click Didn't Get a Code on the sign in screen and choose to send a code to your trusted phone number. You can also get a code directly from Settings on a trusted device. Learn how to get a verification code.
Thanks and have a wonderful day.