The lender or collection agency cannot do anything until it goes to court and then gets a judgment. This can easily take months from the time the company actually files the court papers. So, the short answer is that you can in all probability file a bankruptcy petition
well in advance of this.
As a matter of fact, filing the petition will prevent the company from getting a judgment, and should result in a dismissal of any case that is started.
However, if the company did get a judgment before you filed a bankruptcy petition, they would not be able to touch your exempt assets, such as pension
plans (including a 401k), $60,000 equity
in the home, and $5,000 worth of motor vehicles.
However, there is no
exemption for bank accounts, stock, or wages