Hi malika253
welcome to the Apple (user-to-user) Community!
Re: "I had an old iCloud account and I changed it to a new iCloud,
and the old iCloud account had an amount to pay,"
Your Apple ID is the one account you use to access Apple services like the App Store, Apple Music, iCloud, iMessage, FaceTime, and more. It includes the email address and password you use to sign in as well as the contact, payment, and security details you use across Apple services.
Unless you have created a second Apple ID,
seems you just need to ensure a payment that Apple can accept is listed.
Either way:
Re: "the old (iCloud) one is locked and cancelled"
First: Find out how to pay an unpaid order.
Also check:
Payment methods that Apple can accept in your country or region:
Payment methods that you can use with your Apple ID - Apple Support
With an active subscription: You may need to add a new card before you can delete an old card
How to add an Apple ID payment method:
Add a payment method to your Apple ID - Apple Support
How to delete an Apple ID payment method:
Remove a payment method from your Apple ID - Apple Support
How to change an Apple ID payment method:
If you need to change or update your Apple ID payment method - Apple Support
You may need to allow 24 hours for payment changes / updates to come into effect.
or
Restarting your device may help you view recent changes.
All the best :-)