This document explains how to add a payment method to your Apple ID on a Mac, Apple mobile devices, PC, or online. Click here --> Add a payment method to your Apple ID - Apple Support
To find out how to remove a payment method, and what to do if you can't remove your last payment method or use no payment method with your Apple ID, read this article --> Remove a payment method from your Apple ID - Apple Support
Ongoing subscriptions and Family Sharing organizers must always have a payment method present. To edit the cards used for those you may need to first add the new card and make it the primary payment method before removing the old card (see: If you need to change or update your Apple ID payment method - Apple Support ).
"If you change your address, the credit or debit card information that you use with your Apple ID might be automatically updated by your financial institution, and you don't need to take action. But if there's an issue [such as you having a subscription or being a Family Sharing Organizer], add a new card first, then remove the old card."