Each state has their own rules.
Check out http://www.janusequitymanagement.com.
There you will find foreclosure laws for your state and information about short sales.
From your question, I am assuming you want to sell your house.
What happens is:
1. You list your house for sale with an agent - most banks require you do this.
2. You get an offer on your house
3. Your agent or negotiator will submit the offer, plus financial info you provide to the bank
4. A BPO (broker price opinion) or appraisal is done on the house to determine the value.
5. The bank will accept, counter or reject the offer
6. The bank will either release the lien and you do not owe money, or the bank will release the lien on the property but you will still be liable for an amount.
This is where having a GREAT NEGOTIATOR on your team helps get the release of lien and release of liability for the deficiency amount.