If you no longer have access to the phone number used for two-factor authentication but still know your Apple ID and password, go to iforgot.apple.com to start the account recovery process. Follow the prompts, select "No access" when asked about receiving a code, and Apple will guide you through verification. If you're still signed in on a trusted device, you can update your phone number in settings. Without a trusted device, recovery may take several days, after which Apple will contact you with instructions. Once access is restored, update your trusted phone number and consider setting up a recovery contact to avoid future lockouts.