I come across a lot of people who are facing foreclosure or have been foreclosed on and are looking to rebuild their credit, so I have heard a lot of stories. Like the others said, it depends on your unique circumstances, but here is a typical situation.
If you are still living in the home, you may be approached by an agent representing the bank who owns the home now via the sherrif sale. They may come to you offering "cash for keys". This basically means they are going to pay you some money (amounts vary) to vacate the home peacefully in a reasonable amount of time and leave the home clean and in decent shape. This benefits both you and the bank.
Also around this time you will likely be served with a summons to appear in court for an eviction hearing. By all means show up because if you don't the bank will enter a default judgement against you and they can kick you out on the spot. When you show up, most likely there will be an attorney representing the bank there. You'll have a chance to speak with the attorney prior to going before a judge. Be honest with the attorney, let them know if you are in a cash for keys negotiation or if you've spoken to the bank's realtor, and also give an idea of when you can vacate the home. In Michigan once the redemption period is passed, which it sounds like it is, the standard is 30 days to vacate the home, but if you need a few weeks or a month more maybe then the lawyer may be empowered to grant that to you.
Worry to hear about your situation but best of luck!