"My house is about to be foreclosed. Will bankruptcy stop that?" I'm often asked that question. The answer is probably "yes", but let's look at a "no" answer first.
Chapter 7 bankruptcy
This is the type that gets rid of your debts quickly, and is the type that most people think of when they say "bankruptcy". Filing a Chapter 7 bankruptcy actually would stop a foreclosure sale of your house, but not for long. Why? Because there is no provision in a Chapter 7 for paying off your back mortgage payments over time. The lender could quickly get the court to allow the foreclosure sale if you were still behind on payments.
Chapter 13 bankruptcy
This is a payment-plan bankruptcy where you pay your creditor something each month for three to five years. You also can pay off your back mortgage payments monthly over that three to five years. This type of bankruptcy will stop a foreclosure sale of your house and will keep it stopped as long as you continue to make all required payments.
For more on this subject, see Can bankruptcy save my house from foreclosure?