Although cleaning your carpets before you move out will probably help you get your security deposit back, it doesn't come for free. Be careful not to over wet the carpet or this could cause mildew. If you have a little cash, go to a janitorial supply company and purchase their cleaners in bulk. This way, you'll only be paying for the cleaner, and the solution won't be diluted. If you think household cleaners aren't going to do the trick, you should see about renting a professional cleaner.
Some people find the best option is to simply purchase a carpet cleaner.
If the carpets are overwet, this can damage the carpet backing and underlayment and can cause shrinkage, discoloration, and odor. Although they usually work better than home steamers, dry machines and chemicals are more expensive than steamers and wet extraction solutions. Another alternative , if you don't have the time or the patience to clean your own carpet, is to call a carpet cleaning professional. Check your local newspaper or Yellow Pages for carpet cleaners near you. Keep in mind that if you're living in an apartment, and you don't get the stains out before your lease is up, your landlord could see this as grounds to replace the carpeting.