Two-factor authentication issue

I’ve changed phone number and I can’t get security code by this number anymore.
When I’m trying to reset my password, 2fa asks me to enter 2fa code and I can’t change delivery methods.
How to manage with such situation?

Ideally by using a recovery code instead, as it says at the bottom of the screenshot. Once logged in you can update your 2FA settings.

If you lost the recovery codes there might be other options, depending on what you have, see here: Recovering your account if you lose your 2FA credentials - GitHub Docs