Hi, The_Apple123.
We appreciate you taking the time to post in the Apple Support Communities.
We understand that your Apple ID is requesting that you verify your credit card on file when trying to purchase music, but you want to make sure the gift card is used for the actual payment.
The request to verify your credit card on file is more of an account identity verification, and not requesting payment for the content you’re attempting to purchase. You will likely get the same prompt when you attempt to download something free from the App Store. Once you’ve verified your card you’ll be able to use your account, and the purchase will go through and charge your Apple ID balance. Note that you’ll need to redeem the gift card for the balance of the gift card to be transferred to your Apple ID balance.
Redeem your App Store & iTunes Gift Card - Apple Support
This article explains that your Apple ID balance will be charged first, then your primary payment method for purchases:
How apps, content, and subscriptions from Apple are billed - Apple Support
Warmest Regards.