Never let your landlord steal your deposit.
Here's how you prevent this (without using brass knuckles):
Read your lease before you sign it. Once you've signed it, it's too late to change anything or decide you don't like something in it.
Keep copies of your lease, and any other document your landlord sends you.
Do a photo walkthrough before moving anything I to the house. Take lots of pictures of everything. Make sure to get good photos of pre-existing damage.
Don't fuck up the house, beyond regular wear and tear. You ever get so mad you want to punch a hole in the wall? Well don't. Go to therapy instead. And if you do punch a hole in the wall, either fix it or expect that your landlord is going to take it out of your deposit. You get the point.
Follow the "move out" conditions of of your lease to the "T". If something is supposed to be clean, clean it. If something is supposed to be replaced, replace it. If you don't like having to clean or replace something that's required in the lease, then you should have paid more attention to step 1.
Do a photo walkthrough after you have completely moved out and every move out condition of your lease has been met. Take pictures of everything.
Retain all photos and documentation until your deposit has been fully refunded.
Do not accept a partial refund. Don't sign the check. Don't deposit it.
If the landlord tries to steal your deposit, communicate your objections in writing. Retain copies of all communication.
If the landlord still refuses to refund the full amount and you have followed all the prior steps, march right on down to your local district court clerks office and ask to file a suit in small claims court (assuming your state has a small claims division).
They will ask you to fill out a few forms and pay the court fees. Then, the sheriff will serve your landlord with a summons and the clerk will notify you of the hearing date.
If your landlord is smart, they will settle. If not, go to the hearing, present your evidence to the judge and if you did everything right, get a judgement in your favor. You won't need a lawyer as lawyers are typically not permitted in small claims.
The one and only time I had to do this, I didn't do it because I needed the money. I did it because I knew that I wasn't the first person they tried to fuck over. I was just the first person to fight back and I hoped maybe next time they would think twice about stealing money from their tenants.
Crazy that you have to go to court over it (I assume this is for the US). Here in the UK the deposit has to be secured by a third party independent organisation. So you follow everything you said, but step 10 becomes "submit your evidence on a website" and the landlord has no power over the verdict. I had to do it once and the landlord immediately conceded without even sending them their version of the story.
I hear in some states you can get triple if it has to go to the courts. That's better. There should be a massive downside to stealing a deposit. I don't like if it's a pain in the ass for the victim but then they can only get what was due in the first place.