Re: "How do I apply Apple Account balance to clear an unpaid subscription when my account is locked due to a declined card?"
Seems you can not, as it is always our own responsibility to keep a valid payment method available in an Apple account when we have any active subsciptiions. Legal - Apple Media Services - Apple
You might want to check which payment methods Apple can accept in your country or region.
Payment methods that you can use with your Apple Account - Apple Support..
Also: If you are in India: About billing for Apple subscriptions and media products in India - Apple Support
or
If you are in Europe or Japan: About billing and purchases in Europe and Japan - Apple Support
_______________________________________________________________________________
Re: "I have Apple Account balance available, but my account is locked due to a declined card.
I need the balance applied to clear an unpaid subscription so I can remove the card."
Seems Apple was not able to apply that balance for the subscriptiion payment, as Apple did not do so.
You would likely need to clear the unpaid subscription amount before you can regain access your account at all.
To find out how to pay an unpaid order.
See: If a message says 'billing problem with previous purchase' or 'verification required' - Apple Support
and
If you still need help: If you are still unable to resolve your unpaid balance, contact Apple Support.
______________________________________________________________________________
FYI: Not all subscriptiions and purchases can be paid for using an Apple account balance.
The account balance is most generally used for purchase of Apple's own products.
See: What you can buy with your Apple Gift Card or Apple Account balance - Apple Support
Eg: says: "Some purchases might require that you have a credit card on file,
even if you use your Apple Account balance to make the purchase".
_________
If needed: See how to: Add a payment method to your Apple Account - Apple Support
What to do: If you need to change or update your Apple Account payment method - Apple Support
or
How to delete an Apple Account payment method:
Remove a payment method from your Apple Account - Apple Support
Billing and Subscriptions support Page
Subscriptions and Billing - Official Apple Support