Bankruptcy usually doesn’t provide relief, except in the most dire of circumstances. Even death isn’t a good enough excuse for discharging some private loan debts. And the government can wield a heavy hand to collect what it is due: If you fail to repay your federal loans, it can garnish up to 15 percent of your wages or take your tax refund or part of your Social Security benefits.

But if you are having trouble paying back what you owe because you’ve lost your job or have some other financial difficulty, you have options. Of course, it’s always best to take corrective action before you’re officially in default. For federal loans, it generally takes about nine months of missed payments. But you can go into default on a private loan as soon as one payment is missed, though the rules vary by lender. And collection charges are usually steep.

“The good news on the federal loan side is that there are a lot of options for borrowers, particularly those who are in shorter-term financial trouble now,” said Deanne Loonin, director of the National Consumer Law Center’s Student Loan Borrower Assistance Project. “The private loan side is where we don’t have or are unable to give a lot of general information because there just aren’t as many rights.”

You first need to figure out what types of loansyou have: federal, private or a combination of both. You can find out by calling the lender, accessing the National Student Loan Data System of federal loans, or FinAid.org’s Web site. Below are several options for both loan types.

Federal Loans

¶Defer or Forbearance All federal loans have a grace period of six months after graduation. But an unemployment or economic hardship deferment and forbearance can each buy up to three years, for a total of six years of relief. Deferments are preferred because the government generally pays interest on subsidized federal loans, though you’re still responsible for interest on unsubsidized and PLUS loans. With a forbearance, you are responsible for all interest (even on subsidized loans), which is added to the loan balance.

“Students may not fully appreciate just how much that increases the size of the loan,” Mr. Kantrowitz said. “That’s why deferments and forbearances should mainly be used as a method to solve a temporary problem.”

A six-month deferment is reasonable: it would add $345 to the balance of a $10,000 loan with a 6.8 percent interest rate.