1. Create a liability account for prepayments. From Settings, open Chart of accounts and click New. Choose Other Current Liabilities as the account type and name it something like "Customer Prepayments" or "Unearned Revenue." You only set this up once.
2. Create a product or service item that points at the liability account. Go to Settings, then Products and services, then New. Make a non-inventory or service item called "Prepayment" or "Retainer," and on its setup, point the income account field at the liability account from step 1, not a normal income account.
3. Record the prepayment using that item. If the customer pays before any invoice exists, use + New, then Sales receipt (if they paid immediately) or Invoice (if you're billing them for the deposit itself), and use the prepayment item on the line. The money posts to the liability account instead of inflating revenue for a job you haven't done yet.
4. Do the actual work, then create the real invoice. When the job or service is ready to bill, create a normal invoice listing what you actually delivered, same as any other invoice.
5. Apply the prepayment against the new invoice. Add a line to the invoice using the same prepayment item from step 2, entered as a negative amount equal to the credit the customer has on file. This reduces the invoice by what they already paid and moves that same amount out of the liability account into real income, matched to the work it actually covers.