To refund a deposit when a user terminates their plan or membership at your space, you will need to log in to your payment gateway account (e.g. Stripe, Authorize.net, etc.) and trigger the refund manually.
For easy tracking of who you have collected a deposit from, consider creating a custom user property for 'Deposit'.
Note: You can not refund a dollar amount in Optix. Learn more about how to process a refund here.