Hi user1232
Thanks for your post. How you handle this will depend on what the payment is for. If it's a customer payment you would need to create a customer return and then process the refund. These Help Articles have detailed information on dealing with customer refunds:
Customer returns, credits and refunds
Settling customer credits
Customer overpayments and double payments
If you recorded a Receive money transaction for the payment you would allocate the refund to the same account as the payment. This will clear the amount from that account.
Please let me know if you need further help.
If my response has answered your enquiry please click "Accept as Solution" to assist other users find this information.