Hi there Fatima32,
We understand you're being asked for your old passcode after signing into iCloud on your iPhone, and we'd be happy to help!
To get started, do you have two-factor authentication enabled on your Apple ID that you use with your iPhone? If so, we do want to let you know that this is a normal part of the flow that protects certain user data, such as the passwords, credit card numbers, and Messages stored in iCloud.
If you're unable to remember the the passcode requested, do you see an option to tap “Forgot”? If so, go ahead and select this option. From there you may see an option to approve from another device. This can be any other Apple device that is signed into your Apple ID and has been fully approved.
If you're unable to continue by approving from another device or by providing an old passcode, you should then see an option showing “Can’t Approve”. This would allow you to reset your end-to-end encrypted data on your account. Resetting your end-to-end encrypted data erases the items listed in this link, iCloud security overview - Apple under the “End-to-end encrypted data” section.
After resetting your data, you can continue using end-to-end encryption immediately, and resetting won't delete passwords and other data that already exists locally on your Mac computers or iOS devices.
We hope that helps.
Take care!