If you're behind on any debts, the last thing you want to worry about is having a court mandate that part of your earnings be withheld and sent directly to the creditor or person to whom you owe money until your debt is resolved. But there's a silver lining: If your wages are about to be garnished because you're behind on a credit card, student loan or other debt, it likely won't be a surprise. Even better, there are smart money moves you can make to help you rebound, pay off debt quickly and mitigate the impact of wage garnishment. With that in mind, read on to learn more about how wage garnishment works and tips to avoid emptying your bank account. [See: What to Do If You've Fallen (Way) Behind on Your Credit Card Payments.]How wage garnishment happens. "A garnishment is a judicial mechanism that tells an employer or bank to withhold or direct the finances of a third party to go into the court's trust. In order to get to that point, first there has to be a judgment against that person," explains Brad Biren, an injury law attorney in Des Moines, Iowa. "That judgment merely states that a plaintiff has the rights to the money."Without that garnishment order, your wages can't be garnished, Biren says. However, that's assuming a non-government agency wants your money. For instance, if you have unpaid student loans, the Department of Education could garnish up to 15 percent of your paycheck – without taking you to court first. The Internal Revenue Service won't take you to court, however, you will receive warnings in advance, including sending a notice via certified mail of your right to a Collection Due Process hearing, which means a garnishment is likely imminent (generally within 30 days of the notice date). Though the exact timing of when a lender or federal agency may garnish wages may be unexpected, if it happens, it's unlikely to be an event you didn't see coming.Also keep in mind, there are different types of garnishment: wage garnishment and non-wage garnishment. With wage garnishment, your employer must divert part of your paycheck to your creditors; with non-wage garnishment, your employer won't be notified, but your money will be seized from your bank account. What types of debts are eligible for wage garnishment? In short: just about anything. A debt is a debt. Even Social Security benefits, though not Supplemental Security Income, can be garnished. How much can be taken varies, but the federal government can take up to 15 percent of your benefits for unpaid taxes, and up to 65 percent if you owe child support. In fact, back payments to child support and alimony are the most common reasons for wage garnishment, according to a 2014 report from Automatic Data Processing Inc., a human resources software and management company. The report found that 7.2 percent of American workers have had their wages garnished. What's more, according to the report's findings, 41.5 percent of garnishments were for child support payments, and 18.3 percent were for tax debts. After child support and tax debts were other common debt categories, such as consumer and student loan debt."Most of the wage garnishments I see are for debt collection cases," says Jonathan Stein, a consumer law attorney in Elk Grove, California. "In other words, people stopped paying a credit card or a loan, were sued and now have a judgment against them." On the plus side, it is possible to be in a situation in which your wages can't be garnished. If you make less than $217.50 a week, your wages can't be garnished for credit card or some other types of consumer debt. [Read: Trying to Dig Out of Debt? Don't Make These Mistakes.]How much of your wages can be garnished? "How much is garnished varies (from state to state). California limits garnishments to 25 percent of a paycheck," Stein says.But there are exceptions, even when a state limits how much can be garnished, and it depends what type of debt you owe. "Depending on the circumstances, up to 65 percent can be garnished if the amount due and owing is based on a child support order," says Arthur Ettinger, co-chair of the family law department at Greenspoon Marder's New York City office.As for taxes, if you have a tax refund coming but you owe the government money, the federal or state government can garnish it after it's deposited in your bank account. "Federal government wage garnishments tend to be more harsh in the amount that they take from a person's paycheck than a garnishment for a judgment," says Ashley Morgan, a bankruptcy attorney in Herndon, Virginia. Her firm, Ashley F. Morgan Law, PC, also has a staff attorney who helps clients deal with tax debt.The IRS uses a specific form to determine how much gets sent to them versus what the taxpayer gets to keep in their pay. "This formula depends on how often you are paid, number of exemptions and filing status," Morgan says.How harsh can the IRS get? It depends on a number of factors, such as your filing status, pay period and how many dependents you have. But you could see approximately half of your paycheck gone. It can be worse if you're a freelancer, according to Morgan. "Independent contractors face a much greater risk as 100 percent of their pay can be garnished by the IRS," she says. Taxpayers "must get into an official payment agreement with the IRS to have the garnishment released. Every situation is fact-specific, but they can potentially be released in one day, if you are eligible and qualify for certain payment arrangements."And if you're a contractor, in many cases (with the exception of the government), creditors won't come after you. In that case, Ettinger says, "an income execution (wage garnishment) is likely not the proper legal remedy in order to enforce a judgment as it would be futile." But that doesn't mean independent freelancers can shirk paying off debts. "There are several other enforcement remedies available, including contempt orders, suspension of licenses, liens on property, just to name a few," Ettinger says.What to do if your wages are garnished. Step one: Seek help. That could mean hiring an attorney to work things out with your creditor or help you determine whether it's worth filing a written objection to your wage garnishment and going through a hearing. Or you may want to try negotiating a payment plan with your creditor. You also may want to consider working with a credit counselor, says Howard Dvorkin, a certified public accountant and chairman of Debt.com, a consumer education site about debt. Even if a credit counselor can't help you negotiate a better deal, he or she can help you manage your other debts.[See: 8 Financial Steps to Take After Paying Off a Debt.]When you get to the point where your wages are being garnished, you need to make some changes in your life, Dvorkin says. "If your wages are being garnished, that's a sign. Actually, it's an omen. Your financial life is a mess," he says. "In fact, wage garnishment means you can't be trusted to pay what you owe, so someone else is seizing your paycheck to make sure you fulfill your obligations. It's depressing, and you're reminded of it every time you get a paycheck. If you're facing this awful situation, you need help.".