If you have replaced the Credit Card that was a registered payment method associated with your AppleID, you simply need to update your AppleID account with the new Credit Card details.
See:
Change, add, or remove Apple ID payment methods - Apple Support
If you only have a single Credit Card set-up for your AppleID account, you will need to add the new Credit Card to your AppleID account - after which you will be able to delete the old card details.
It is often a good idea to have two (or more) payment cards associated with your account - as, in case there is a problem with your primary card, a charge can be made to the second card without risk of impacting ongoing access to your AppleID account or associated services and subscriptions. With multiple Credit Cards, you can choose the sequence in which card payments are made.
You may find these support pages to be helpful:
If you need to change or update your Apple ID payment method - Apple Support
Add a payment method to your Apple ID - Apple Support
Remove a payment method from your Apple ID - Apple Support
Payment methods that you can use with your Apple ID - Apple Support