"autopay: Actually i booked a subscription for duolingo and late i cancelled my subscription before the free trail
ends but how did the payment was done Even though it was cancelled"
For subscriptions purchased through Apple:
Seems a free trial needs to be cancelled at least 24 hours before the trial period ends.
That is, if you do not want to continue the subscription and pay for the next subscription period.
If you have cancelled the subscription successfully, you could try asking for a refund:
(Eg: Refund may, or may not, be approved.
If approved, the funds return to the payment method charged, given time.)
See how to: Request a refund for apps or content that you bought from Apple - Apple Support
Else: If the free trial was not made through Apple:
The linked article below may help you find answers:
About purchases not billed through the App Store or the App Store’s In-App Purchase system - Apple Support