Filing for bankruptcy regarding a potential lawsuit can prevent the plaintiff (the person who is suing you) from collecting a judgment or placing a lien on your home. You can file even after you have been sued but if you wait until after the lawsuit is over and the court rules against you, any damages levied against you will become a secured debt; you may  not be able to discharge it through bankruptcy at that point.However, you will need to decide which chapter of bankruptcy to file under. If you file a Chapter 7 bankruptcy, all of your property that is not legally exempt can be sold off to meet your debts; once the property is gone so too are your debts (all of them, not just the amount oed for the lawsuit). If you file a Chapter 13, you can keep your assets but you must enter into a repayment plan (3-5 years) under which your all of creditors are paid a discounted amount of what is owed them.This is just a basic explanation. At this point, you should consult directly with a bankruptcy attorney in your area. They can best advize as to your spedific situation.