English landlord here. (rules are different Wales/Scotland anywhere else)
England - read your how to rent guide.
assuming the deposit is protected in one of the three schemes (if not, sue) then the scheme is biased towards the tenant, as it should be because it is your money. You should have had a notification of which scheme (if not, you can sue). If you didn't, it doesn't take long to contact all three.
for any deductions, landlord has to prove damage (not wear and tear). Unless there is a detailed inventory at check in and check out this is almost impossible, although a dodgy landlord may try it on. If that happens, just follow the dispute procedure.
shabby grout/needing repainting/carpets worn due to walking on them etc etc is wear and tear.
clean up, remove all your stuff including rubbish, make good any holes in walls but do not repaint (that's betterment) and that's it really. Take meter readings on departure day and close the accounts, do the same for council tax. Set up a post redirect and get a signature for returned keys.
job done.