Hi there,
Welcome to the Community. QuickBooks is a powerful program that helps you to manage your accounting with ease. I'll be happy to share more info so you're on the right track with your work.
In order to manage your transactions the correct way, I recommend consulting an accounting specialist for expert advice. This ensures your books remain accurate while you continue to manage your work with peace of mind. You can also get in touch with a professional using this link here. Other accounting professionals are able to see this post in the Community and this will allow them to chime in. In the meantime, feel free to check out this helpful article that shows you how to: Handle a customer credit or overpayment in QuickBooks Online. The article provides more info on how to create a credit and record the refund.
Let me know if this info helps. I'll be here to help.