"Usually" is quite correct. You basically have to prove there would be no hope of being able to pay it back without severe financial hardship, and the bar for hardship is fairly high. Even when some student debt is discharged in bankruptcy, it's often a partial discharge.