Do you remember the Apple ID and password for 2FA , is that single trusted number lost / damaged or you used some one else trusted number and the code goes to that number and you can't access it .
If you directly sign into www.icloud.com with account credentials definitely the code will go to that number that is not in your possession , but you have other ways to sign , click on get a verification code , the code will be displayed on Mac screen .
In password and security section , click on edit as shown in the screen shot , click on plus sign , the trusted numbers will be shown , you have to first add your trusted number and get it verified , then removed unwanted number authenticate the account with admin password .
See the article Change Password & Security preferences for your Apple ID on Mac - Apple Support