Sign in to your Apple ID account page and edit / update your Apple ID details -> https://appleid.apple.com
- On the Sidebar click Payment methods -> then tap Payments Methods and tap Manage payment method.
Or see -> Add a payment method to your Apple ID -> Add a payment method to your Apple ID – Apple Support (UK)
- If you want to change your card, you need to add first the new card, then remove the old card.
See the following Apple articles:
Payment methods you can use with your Apple ID
Payment methods you can use with your Apple ID – Apple Support (UK)
fyi: Not all credit & debit cards seem to work with App Store / iTunes Store, try a different one, or preferably a credit card. If your card is not accepted as a paymenf method, you need to contact your bank.
If you need to change or update your Apple ID payment method
If you need to change or update your Apple ID payment method - Apple Support
If you update your payment method or add funds to your Apple Account balance, It would take about 1 to 3 business days in order to process.
If you're still unable to update your payment method, Contact Apple Support.
If you still need help, get more help and assistant from Apple directly, see Contact Apple for support and service -> Contact Apple for support and service – Apple Support (UK)
-----
I have no idea how that card is even on my account because . . . .
A question: does your ex has access to your Apple ID / account?
Check for sure to keep your Apple ID account secure, see the following Apple articles:
If you think your Apple ID has been compromised -> If you think your Apple ID has been compromised - Apple Support
See who has access to your device or accounts
See who has access to your iPhone or iPad – Apple Support (UK)
Delete suspicious content from your devices -> Delete suspicious content from your devices – Apple Support (UK)
Check your Apple ID device list to see where you're signed in
Check your Apple ID device list to find where you're signed in - Apple Support
- if you see devices that don't belong to you, delete from your account.
Personal Safety User Guide -> Personal Safety User Guide – Apple Support (UK)
Manage and use your Apple ID -> Manage and use your Apple ID – Apple Support (UK)
(if you haven't already done this) Two-factor authentication for Apple ID -> Two-factor authentication for Apple ID - Apple Support
Change your Apple ID password -> Change your Apple ID password - Apple Support
- Create a strong password for your Apple ID, It is best if your password consists of eight or more characters and include upper and lowercase letters, and at least one number. You can also add extra characters and punctuation marks to make your password even stronger.
- Never provide your password, passcode, security questions, verification codes, recovery key or any other account security details to anyone else. Apple will never ask you for this information.
Then see this Apple article: What to do after you change your Apple ID or password
What to do after you change your Apple ID or password - Apple Support
Never jailbroken your iPhone.