It’s a classic Catch-22: You’re in rough enough financial shape that you need to file for Chapter 7 bankruptcy — but you have to pay hundreds or even thousands of dollars to do so.

The filing fees for a Chapter 7 bankruptcy total $335, but that’s only part of the picture. You’re likely to pay between $500 and $3,500 to your attorney, depending on where you live and the complexity of your case.

Your strategy for how to pay for bankruptcy could include:

The first option takes creativity and hard work. The last two require you to show financial need, so gather your tax statements and documents on your income and expenses before meeting with any legal counsel.

A few simple steps can help you free up or find more money for your bankruptcy.

The first: Minimize your outgoing cash. “If you’re still paying your credit cards, stop paying them,” New Jersey bankruptcy attorney John Hargrave says. “You’re just throwing that money away if you’re going to file. Save that money and put it toward your bankruptcy.”

Chapter 7 bankruptcy wipes out unsecured debts like credit card balances, so it makes little sense to keep paying toward them if you’ve decided to use this debt relief option.

Next, try to get some additional income. Anything from selling old electronics to taking on a part-time job as a dog walker can earn you some fast cash.

If you’ve already pawned your flat screen TV and started a dog walking service but still don’t have enough to cover your bankruptcy, try asking family and friends for some money. If you have a retirement account, you can try tapping into it. That’s truly a last resort, though, as it could jeopardize your ability to save enough for retirement.

You may be able to spread out the costs of your attorney and filing fees.

The first step is finding the right attorney. In this case, beyond the requirements of expertise, fair compensation and good communication, that means finding one who is willing to work out a payment plan with you. Ask about the possibility in the initial meeting with any bankruptcy lawyer you’re considering.

Payment plans vary; some lawyers will allow you to spread payments over six months, others three months. But most attorneys want full payment before you file your case: Since Chapter 7 bankruptcy wipes out most of your debts, you wouldn’t be legally obligated to pay outstanding attorney fees after filing. That’s just not a sustainable business plan.

But even while you’re making the payments, you can still get some benefit, Hargrave says. Once you officially hire someone, the lawyer can take calls on your behalf, getting creditors off your back even before you file. When you discuss setting up a payment plan, ask how much of the fee you must pay before the lawyer will begin taking calls from creditors.

“When people hire a bankruptcy lawyer, they know the fear of going to the mailbox, the fear of what phone call is going to come next. That evaporates when you hire an attorney,” Hargrave says. “That’s a huge benefit for people.”

Your attorney is likely to start working on your case in earnest only after you’ve paid in full. Then, if you need, the attorney can work with the court on a payment plan for your bankruptcy filing fee. The $335 fee can be split up into as many as four payments.

You might qualify for free legal services or waived fees if your income is less than 150% of the official poverty line for your family size and you’re unable to afford a payment plan.

There are a few ways to find a pro bono attorney. First, your local bankruptcy court will have information on free legal clinics and local free legal aid resources. Legal aid organizations can offer you free legal help if you meet their need guidelines, and they may be able to connect you with a pro bono bankruptcy attorney. Be prepared: Legal aid organizations are often underfunded and overworked, but getting on their list for legal help is a good first step while pursuing other options.

The American Bankruptcy Institute has a bankruptcy attorney directory that can help you find pro bono attorneys in your area.

You can also reach out to your state’s bar association to see if you can get help from a bankruptcy attorney who is willing to take a pro bono case. At some firms, attorneys are required to make pro bono work 10% to 15% of their caseload. Just make sure you feel confident working with that person.

While you may feel a little odd asking for free representation, Jim Carman, communications director of the American Bankruptcy Institute, says bankruptcy lawyers are accustomed to the requests.

“They understand that people aren’t coming to them lightly, and they’re going to understand that there’s a certain tightness in the wallet,” Carman says. “If people are in that kind of extreme situation, they really need to seek out a pro bono attorney.”

Lastly, you can hire a petition preparer if you’re in a hurry to file. A petition preparer will help you fill out your paperwork for an hourly fee that can be as low as $70. A petition preparer can’t give you the legal advice that an attorney can provide, but this is an option if you just want to get your bankruptcy filed in order to trigger the “automatic stay” that halts collection efforts.

If you’re thinking of filing on your own, without any legal assistance whatsoever, Hargrave advises one thing: Don’t.

“There’s a jeopardy in doing a bankruptcy by yourself,” he says. “Even if you’re a well-educated, articulate person, the law still has a lot of jargon and technical stuff that you, without assistance of a lawyer, could screw up.”

Making a mistake on your paperwork can lead the court to throw out your case, wasting the effort and money you’ve put into it.

Chapter 7 is confusing, and worrying about how to pay for bankruptcy makes it even worse. If you’re struggling to pull together enough money to pay for your filing fees and attorney, these options can help you get on the right track toward getting your debts forgiven.

From there, you can start to rebuild your credit, work out a budget and get on the path toward living debt-free.

Sean Pyles is a staff writer at NerdWallet, a personal finance website. Email: spyles@nerdwallet.com.

The article How to Pay for Bankruptcy When You’re Broke originally appeared on NerdWallet.