Assuming that you have only a single payment card configured for your AppleID account, the edit button will be disabled as you observe; you must first add a new payment card - after which you can delete the old (expired) card details.
Having at least two payment cards defined for you account is recommended, as in so doing you will have a secondary payment method available. If for any reason your primary card has expired, or a charge is declined, having a secondary payment method reduces the likelihood of Apple services or subscriptions being suspended due to a failed payment.
If you have multiple cards configured, the editing button is enabled.
Change, add or remove Apple ID payment methods – Apple Support