How to refund a membership
Refunding the payment and removing the membership are two separate actions. Most of the time you'll want to do both.
Refund the payment
Go to Accounting, then Transactions. Find the membership purchase in the list and select Refund. The amount goes back to the card the customer paid with. See Accounting transactions (payment log) for more on this page.
Remove the membership
A refund doesn't remove the membership on its own. To end it, go to Customers, search for the customer, and click their name to open their customer card. In the membership section you can remove the membership.
For more on ending a membership, including what happens to a member's remaining time, see How can I cancel a membership.