To get a refund for a subscription paid by mistake, cancel it first, then make the request to the store that took the money.
Cancel the subscription so the payment does not come back: Settings > your name > Subscriptions (iPhone), or Google Play > profile picture > Payments and subscriptions > Subscriptions (Android).
iPhone: go to reportaproblem.apple.com, sign in, choose the purchase, then Request a refund.
Android: in Google Play, open your order history, choose the purchase, then Request a refund.
Explain in one sentence what happened. You should receive an email confirming the request.
If you don’t see it: the purchase may have been made on the app’s website. Write to its customer service instead.
Limitation: the store decides case by case, and a refund is not guaranteed. Make the request quickly: for a purchase you did not make, Google accepts reports for up to 120 days.
To picture it: it is like returning to the store an item you did not mean to buy.
Trusted links: Google Play refunds · Abonnements automatiques (Protégez-Vous, in French)
