Hey there! Nice to meet you!
You will have to turn off the automatic renewal first before removing the payment method by signing in to your account on account.microsoft.com > Subscriptions > Locate your subscription > click on "Manage" > then select "Turn off recurring billing"
Once it's done, go to "Payment Options" > Locate your payment method > then select Remove.
If the issue persists, or if the expired credit card is not linked to any subscription, you may contact Microsoft Billing Support for further assistance:
https://support.microsoft.com/home/contact?SourceApp=smc2&ContactUsExperienceEntryPointAssetId=S.HP.SmcContactUsLanding
Type "remove payment method" > click "Get Help" > Scroll down to Sign in to Contact Support > click "Contact Support" > Microsoft 365 and Office > Billing and Payment Updates > Confirm > Chat with a support agent in your web browser
Please let me know if you need anything else.
Best regards,
Darhyl