Meet the 30-day protection deadline, and hand the deposit back at the end without a dispute.
A deposit must be protected in a government scheme within 30 days. You must also give the tenant the prescribed information.
Miss the deadline and you cannot serve a valid Section 21, and the tenant can claim up to three times the deposit.
Abodient tracks the duty on the property's Tenancy tab, under Paperwork.

Deposit protection shows as missing until you upload the certificate.
Two Inventory items sit alongside it. A check-in inventory at the start is what lets you prove damage at the end. A check-out inventory records the state you got the property back in.
Recording the deposit amount on the tenancy is not the same as protecting it. Protection happens in the scheme, and the certificate is filed here.
Return the deposit, less any agreed deductions, through the same scheme. The check-in inventory is your evidence for anything withheld.