Bankruptcy Law Questions? Ask a Bankruptcy Lawyer.
I assume you're talking about a Chapter 7 type of bankruptcy and whether a student loan is dischargerable (goes away). You can "get rid" of a student loan in bankruptcy but it is not easy.
Student loans are difficult, but not impossible, to discharge in bankruptcy. To do so, you must show that payment of the debt "will impose an undue hardship on you and your dependents."
Courts use different tests to evaluate whether a particular borrower has shown an undue hardship. A common test is the Brunner test which requires a showing that 1) the debtor cannot maintain, based on current income and expenses, a "minimal" standard of living for the debtor and the debtor's dependents if forced to repay the student loans; 2) additional circumstances exist indicating that this state of affairs is likely to persist for a significant portion of the repayment period of the student loans; and 3) the debtor has made good faith efforts to repay the loans. Different bankruptcy courts are different and some are tougher than others.
Most other loans are dischargeable as well, aside from child support, alimony, and taxes. Please follow up with any questions you have.