Once you've determined that you're not renting from Mr. Security Deposit McStealy, you need to start making the case for getting your security deposit back before you even move in. Ideally, your landlord will give you a property condition checklist and the two of you will go around the property filling it out together and then each keep a copy. If your landlord doesn't do this, make sure you do it yourself. You can create your own checklist or most real estate or renters' sites have ones you can download.
In addition to the checklist, take pictures of the entire property -- even up close, detailed photos of fixtures like faucets -- to document what they looked like when you moved in. Do this before you move in a single box of your stuff. Do it in daylight so you can more easily spot issues. As you go around the property, try every light switch, turn on every system (like the air conditioner or heater), flush every toilet and turn on every appliance. If something is broken, document it before you move in so it's clear that you didn't break it. Then follow up with the landlord on a repair plan.
You should also ask the landlord to document the age of certain parts of the property, like the carpet or the paint. Odds are you won't need that information, but if you end up having to fight for your security deposit, the age of things like that could play a key role in how much you're able to get back.