The answer here, like many things, is that it depends.  Filing for bankruptcy can stop the immediate action of a foreclosure or repossession, but cannot always permanently stop the foreclosure or repossession.  If you are behind on mortgage payments or car payments, your lender may discuss foreclosure or repossession.  To stop a foreclosure you must file your bankruptcy prior to the foreclosure sale.  Once a property has been foreclosed upon there is nothing that we can do.  To stop a repossession, ideally you will file prior to the repossession.  However, in situations involving a car, you may be able to get your vehicle back within 14 days of the repossession assuming that it has not been sold by that time.  However, to do this, you will likely incur storage, towing, and other fees that will have to be paid prior to getting your vehicle back. 
So, we can stop the immediate action.  If you have mortgage arrears or past due car payments a Chapter 7 might not be your best option.  If this applies to you, you can spread out the past due payments over a longer period through a Chapter 13 filing.  This may mean that you have to pay back some of your creditors, but you will get to keep you house or car.  If you still want to file a Chapter 7 you would need to become current to keep the property.  A Chapter 7 will stop the immediate action, but cannot permanently stop a foreclosure or repossession if you are not current on payments. 
Perhaps the biggest issue is that you have to be able to afford ongoing payments.  In many cases, when filing for bankruptcy, to keep your home or vehicle, the lender will want you to do a reaffirmation agreement, stating that you will assume the loan under the original terms.  For the lender and the court to accept this you have to show that you can afford the ongoing payments.  In some cases, the debtor can now afford the payment because he/she will not be making other payments.  In other cases, the debtor may not be able to afford the ongoing payments and may end up in the same position again, only this time he/she may not be eligible to re-file for bankruptcy.
If you have any questions, or would like to speak with an attorney, contact a St. Louis Bankruptcy Attorney today!