There are a number of federal laws that affect the foreclosure process. For example, if you find yourself struggling to make ends meet and fail to pay your mortgage, you may find a foreclosure notice in your mail. If you decide to file for bankruptcy, that bankruptcy action automatically halts the foreclosure proceeding.
This may give you time to protect your home and come up with the money necessary to maintain your mortgage, or you may decide that going through with the foreclosure is the best path. Your attorney will work with you to determine the best way forward during your bankruptcy.