If the 2FA is created from an iPhone and that is lost , and if you remember the trusted number say 1234... contact cellular service provider and issue a new sim using same mobile number ( you have to give some proofs of identification that you are only person who used that number to the service provider ) .
Take a new iPhone and insert that sim into it https://support.apple.com/en-in/HT201337
And set the new iPhone https://support.apple.com/en-in/guide/iphone/iph1fd7e482f/ios
Use the same Apple ID and password that remains same with your 2FA account ( you signed in your old lost iPhone ) , the code will come to this iPhone and you can sign in the 2FA account .
If you created 2FA from a Mac , open system preferences > click on Apple ID , again click on password and security , in front of trusted accounts , click on edit , click on plus sign and add your new trusted number and click on done , you can later delete the previous lost trusted number bu clicking on subtract sign .
The new number has to be verified .
Also you can click on get a verification code , a code will be generated write it down , open a new tab on the same Mac ( use command and T keys ) , sign with Apple ID and password at www.icloud.com the code is with you fill it up in the field and you will enter the 2FA account .