The pain of forking over the money for a security deposit when you sign a new lease is only manageable because you assume you'll get it back when you move it. But between moving in and moving out, you might forfeit the deposit without even realizing it.
Money paid for a security deposit isn't really yours anymore and it isn't really the landlord's. It's in this weird limbo meant to cover costs when you move out.
Not paying rent. Each state has its own laws on security deposits but one of the common ways the money can be used is to make up for any rent that's unpaid when the tenancy ends. If you don't pay up, the landlord can take the money out of your security deposit.
Causing damage. Normal wear and tear is generally not covered by the security deposit but damage to the property is. That can include things as small as using nails to put up pictures if the lease mandates tape or vice versa. Avoid making problems that you'll have to pay for.
Failing to tell the landlord about issues. Some things, like mold, grow over time and become a bigger problem if they aren't addressed. While it's not your responsibility to fix those things, you should tell the landlord so they can be dealt with. If you don't, and the damage gets worse you might forfeit some or all of your deposit to pay for it.
Not cleaning up. Before you move out, your landlord should come over with a list of minor repairs and some cleaning that needs to be done before you leave. Things on that list that remain undone will be paid for with your security deposit. Don't leave it to chance, just clean it up.
Giving in. It would be great to get your whole deposit back, but in reality you'll probably lose a bit to random cleaning and repair charges. But sometimes landlords try to take advantage of tenants by withholding the whole amount unfairly. If you just give in and let it happen, you'll get nothing back. Make sure your landlord knows you won't stand for it and are willing to fight for your money.
Of course these aren't the only ways to forfeit your security deposit. To learn more, check out FindLaw's section on Rent and Security Deposits.