There are two types of deposit scheme and you should have been notified which was being used by the previous landlord, they are:
Custodial scheme or Insurance based scheme. At the end of the tenancy with either scheme, if the landlord and tenant have agreed how much of the deposit is to be returned, they will inform the scheme/landlord who will return the deposit.
If there is a dispute with either scheme the scheme holds the disputed amount until the matter is resolved.
If there is no dispute ask the previous landlord to return the deposit, having checked with the scheme provider if unsure.