When you move into an apartment, you usually have to pay a rather hefty security deposit. Make sure you get most of it back with Life Hacker's Tips.
Before you move in, read your lease thoroughly to find out exactly what condition you are expected to leave your apartment in. Before you move in, take pictures of the condition of the unit so you have photographic proof what what it looks like. Discuss any concerns with your landlord in writing.
While you are living in your apartment, if there are damages or appliances break, let your landlord know right away in writing. Keep a copy of your letter or email, along with photos.
If something does go wrong while you live in the apartment, fix it. Even if it costs you money, it's still most likely cheaper than what your landlord will charge you after you move out.
If you want to make any changes to your unit, get written approval from the landlord first and return it to how it was before, if that's what your landlord wants, before you move out.
When you move out, clean the unit thoroughly and putty over any nail or screw holes. You also might consider replacing the toilet seat if it looks worn out.
Try to meet with your landlord and do a walk through before you move out. Ask them if there's anything in addition you need to do to make sure you get your security deposit back. Take pictures of every room and send an email or letter to your landlord telling them exactly what you've cleaned and repaired.
If your landlord doesn't give you all of your deposit back, or is not forthcoming with a list of deductions, you can take them to small claims court.