A verification code for two-factor authentication will be send to your “trusted devices”. If you have an iPhone, iPad, or Mac registered with the same Apple ID account, then those would get a pop-up notification. Without trusted Apple devices, an SMS text message would be send to your “trusted phone number”, as you have supplied for your Apple ID account setup.
Two-factor authentication for Apple ID - Apple Support
Get a verification code and sign in with two-factor authentication - Apple Support
Manage you Apple ID (Sign-in and security﹥Account security) - Apple
On iPhone, iPad, or Mac with the matching Apple ID, users can request a new verification code at any time, superseding what was (intended to be) send earlier.
On the device that wants the code, there could be an option for Didn't Get a Code (e.g. if your iPad or Mac is not with you), to request a code to be send to a trusted phone number instead.