1. Create a liability account for deposits held. Go to Settings, then Chart of accounts, then New. Choose Other Current Liabilities as the account type, and name it something like "Security Deposits Held." You only need to do this once.
2. Record the deposit against that liability account, not an income account. If the money arrives as a standalone payment, use + New, then Bank deposit, and add it as a line crediting your Security Deposits Held account rather than a sales or income account.
3. If the deposit comes in through an invoice or sales receipt, map it with a dedicated item. Create a service or non-inventory item called something like "Security Deposit," and on its setup, point the income account field at your liability account instead of a normal income account. Use that item on the transaction so the money flows to the right place automatically.
4. Returning the deposit. When you give it back, write a check or record an expense from the bank account, coded to the same Security Deposits Held account. This zeroes the liability out for that customer or tenant.
5. Applying it against unpaid rent or damages instead of returning it. Use a journal entry: debit Security Deposits Held for the amount you're keeping, and credit the income or expense account that reflects what it's actually covering (unpaid rent, repair costs). This is the moment the money actually becomes yours, not when you first received it.