Thank you for contacting JustAnswer.com, my name is ***** ***** I will be more than happy to assist you with your support request.
Your iCloud ID and your Apple ID should be aligned with the same email address you used, when first setting up your Apple ID account.
So given that you have just purchased a newer iPhone and you mentioned: "reset code." Do you mean a "verification code"? This important for me to ask, because there are at least three (3) other forms of security that Apple ID users can use to set up their Apple IDs with. (i.e. Secondary authentication which is: Apple ID password + 2-3 security questions that need to be answered correctly)
If you are referring to "verification code", then is quite possible, that your Apple ID account set up with Apple's Two Factor Authentication security on your Apple ID (see https://support.apple.com/en-us/HT204915), which allows you to receive a random 6-digit verification code on a different Apple computer or mobile device whenever you are signing in to another device with your same Apple ID password.
If you don't have any other Mac computer or device that is signed with the same email you use for your iCloud / Apple ID (in order to receive a new verification code), then you can attempt to resend the verification code to your new iPhone - IF, you have the same phone number assigned to your new iPhone, that you had with your previous iPhone. You could then continue with resetting your password.
For other ways to reset your iCloud/ Apple ID password, feel free to visit: https://iforgot.apple.com
Please let me know if this helps. If the information I provided is not clear or you need more assistance, please don't hesitate to reply back to this post. I will watch for your next update.