I had this problem on a previous flat.
I basically wrote a very polite letter stating the facts, that the landlord had confirmed that there was no issue with the state of the flat when we left, and that as per our tenancy agreement, the deposit was due to be returned within 4 weeks of vacating the property, which had not happened.
I then stated that the amount was now due, and gave a deadline (7 days hence) by which the deposit cheque was to be received, and stating that if it was not received by this date, then i would be filing a claim to the small claims court for the fll deposit plus the costs of filling the claim.
For added ooomf to show i was serious, i prefilled in the court claims document with all the details of when he had agreed the flat was ok, when the deposit was due back and any communication i had had or tried to make with him, and sent him a copy.
I got the money back shortly after!!