You have to pay for it and then request a refund.
Confirm you have canceled any subscription automatic renewal (if you simply delete an app this does not cancel subscriptions):
Review the information in this support article by clicking on the link to learn how to cancel a subscription from Apple. ➔ If you want to cancel a subscription from Apple - Apple Support
If you subscribed to this in the EU from a third party, see: About purchases not billed through the App Store or the App Store’s In-App Purchase system - Apple Support instead.
Notes:
• "If you signed up for a free or discounted trial subscription and you don't want to renew it, cancel it at least 24 hours before the trial ends."
• Deleting an app does not cancel a subscription.
• An existing subscription will normally continue until the end of its term and may then renew automatically. Stopping automatic renewal is effectively canceling it. "If you don’t see Cancel Subscription, then the subscription is already canceled and won't renew." The "Expires" date means the current subscription will just run until then. Note special conditions for some countries: About canceling subscriptions in Germany, Israel, South Africa, or Türkiye - Apple Support
• Read the article to see what to do about subscriptions that do not appear in your list. If you still can't find a subscription, contact Apple Support using the link at the end of the support article.
• Canceling a subscription does not automatically start a refund.
If you wish to pursue a refund, follow the directions in this support article about how to request a refund for apps or content that you bought from Apple ➔ Request a refund for apps or content that you bought from Apple - Apple Support
Read this support article for information about how long it takes to receive a refund (if one is granted), and how to check the status of a refund for apps or content that you bought from Apple --> Check the status of a refund for apps or content that you bought from Apple - Apple Support
Note that if you allow another person access to purchasing on a device, or through Family Sharing if you are the Organizer, you are taking responsibility for things they do. Apple offers these proactive features:
On your device you can use Screen Time to prevent unintentional or unauthorized purchases from the App Store, in-app, and other Apple services. —> Use Screen Time to turn off in-app purchases on your iPhone or iPad - Apple Support
Also on your device, require a password for App Store and iTunes purchases —> Require a password for purchases in the App Store and other Apple services - Apple Support
Use Screen Time as part of parental controls on your child's iPhone, iPad, and iPod touch —> Use parental controls on your child's iPhone and iPad - Apple Support
If a child made this purchase on their device, consider activating Ask To Buy—> Approve what kids buy with Ask to Buy - Apple Support