Hello Yooo15,
Thanks for reaching out in Apple Support Communities. We understand that you're having trouble accessing a previous iCloud account. You don't have access to the old phone to get a verification code. We'll do our best to help. If you don't have access to the old phone number to get a verification code, you may need to use account recovery.
Check out the following support articles:
How to use account recovery when you can’t reset your Apple ID password
Get a verification code and sign in with two-factor authentication
If the steps above don't help, reach out for additional support here. Get Support
Cheers!