Select Bonds on the left menu of the Tenancy, then Prepare to Refund (clients in the UK should substitute the word Bond for Deposit, all other functions are the same).

Divide the amount held among the options of refund to tenant, transfer to owner or transfer to the tenancy ledger.  Use the tenancy ledger option if you want to be able to apply the funds to invoices:

If the tenant is receiving a refund, update the Tenancy Invoice Contact with payment method and, if applicable, banking details, then run a Disbursement using a profile which includes Bonds.  The bonds to be refunded will appear on the same page as bonds to be lodged, in orange text so that they look different.