Is there another trusted device? Refer to Get a verification code and sign in with two-factor authentication - Apple Support
A code is sent first via data (via the Internet, not as a SMS text message) to your trusted devices (some other Apple computer or Apple mobile device signed in with your account) automatically. If you have a trusted device running iOS 11 and later, OS X High Sierra and later, iPadOS 13 and later, or watchOS 6 and later, the verification code is displayed automatically on your trusted devices.
If you had set up a recovery contact, have that person get a code. Read Get a recovery code for a friend or family member as their Apple Account recovery contact - Apple Support
If you do not have either of the above normally you would use Account Recovery, except that may require a working email address. In that case contact Apple and see if they have any options to offer.
This support page has information about Apple support and service ➔ Contact Apple Support - Apple Support If live support options (chat and/or telephone) are available they will show near the bottom left.
- Telephone numbers may only work when calling from the same country.
- Chat options (telephone numbers appear as active links, not plain text) may depend upon cellular connectivity. If a number shows as an active link, click on it to see additional options.
- If chat is not available on the top level support page, try selecting your hardware and narrow down your issue to see if a support article offers a support link offering chat. For example, the contact support link on this page Check your Apple Account balance - Apple Support offers a chat link about emptying account balance even on a computer where the top level page does not offer any chat.
With an iPhone, iPad, or Vision, you may be able to chat using the Apple Support App if it is available in your country —> https://apps.apple.com/app/apple-support/id1130498044