The first thing that has to be considered is whether or not you qualify for bankruptcy, and strange as it may seem, this is option is not available for everyone. If a couple is involved, it needs to be decided whether the debt belongs to one person, or both, or in other words whether just one person applies for bankruptcy, or you both do.
Talk to your financial advisor to help you decide on the best course of action, and whether or not you do have any choice or not.
Get your statements together, those showing the debt you owe, who to and what for, as well as your income statements, and your living expenses for the household. Whether your spouse applies for bankruptcy as well as you, both salaries and all expenses need to be shown to the bankruptcy trustee who will walk you through the process, collect all the necessary information and documentation needed and file it in the bankruptcy court for you.
Note that there are costs involved with declaring bankruptcy, and these fees do have to be paid. And yes, it is odd that you have to have funds available to pay to go bankrupt, when it is a shortage of funds that is the whole problem in the first place! Check in your state or province what the fees will be, or you could see a credit counsellor, often at no cost so that you can learn your options and come to terms with your real financial situation.
The job of the bankruptcy trustee is to provide a link between the debtor and the creditors, and to try to get as much money as possible to repay the creditors. A small portion does go to the trustee to pay for the time and effort of the trustee, but these are fixed fees that the trustee does not control.
Once the papers are filed, you still have to report to the trustee with any change in circumstances, any increase or decrease in income, medical expenses and so on. If you earn a lot more one month, the trustee may require that the extra income be split so that some goes to pay back the creditors. There may be a meeting between the debtor and a bankruptcy judge to discover why you have declared bankruptcy, or if the creditors request extra information.
The trustee may require more information from you from time to time, and it is in your best interests to provide accurate information as promptly as possible. After all, you need all the help you can get, so that you can be discharged from bankruptcy and those debts stated in the filing are removed from your debt. You can then start over with your financial life, and hopefully having learned a lot because of your bankruptcy you will be better able to make your life a financial success this time around.