If you work as a freelancer, you know the pride of being your own boss. You’re not alone. Freelancers Union reports over 38 percent of all workers, including over 50 percent of millennials, now work freelance jobs either on the side or as a main source of income.

The talk of the “gig economy” often misses the stress freelancing can bring, especially if expenses become harder to manage and collection calls and letters start rolling in.

Successful people are usually people who know when to ask for help. One reason bankruptcy laws exist is to offer a legal way for people with overwhelming debts to find relief. Knowing more about your legal options might be a first step in regaining control.

Chapter 7 and Chapter 13 bankruptcies are the two types of bankruptcy that are likeliest to apply to a freelancer in the gig economy.

Although Chapter 7 is known as “liquidation” bankruptcy, filers can keep their exempt assets. When you file, an “automatic stay” immediately halts all collection efforts on the debts in question. Ultimately, the court usually discharges, or cancels, some or all your debt and you are permanently relieved of the debts.

Chapter 13 is sometimes known as “reorganization” bankruptcy. It creates an automatic stay and allows you to propose a payment plan in which you pay all or some of your debts over several years. As with Chapter 7, it has advantages and disadvantages to consider and not everyone will qualify.

If you feel you’re drowning in debt, a bankruptcy attorney can help you better understand the bankruptcy process. Most of all, talking with a professional about your debt could help revive your vision of a career as your own boss.