Hi Psb2
Thank you so much for your patience.
In this matter, as we can't simply delete the deposit, the invoice will first need to be reversed. Kindly go to Sales register >> select the Closed Invoices tab > and open the sales transaction >> reverse sale. Please see the sample below:

Once reversed, this will create a credit note for the total amount of the original order. Then you'll need to settle the credit by recording a refund payment. This is explained in this Help article.
Please note that you'll need to set the preferences to allow transactions to be reversed.
Cheers,
Princess