It is illegal for your employer to fire you for filing bankruptcy.
It is also illegal for your employer to fire you for one garnishment. However, your employer can fire you if you get garnishments for more than one debt.
A government agency cannot deny a license or discriminate against you because you have filed bankruptcy, although it can deny you credit if your credit is otherwise bad.
Note that these protections do not apply until you actually file for bankruptcy. Telling your employer that you will file is not enough.