Bankruptcy is a legal remedy, and as such only an attorney can properly advise you on the process. However, as far as being a candidate for the legal process, that is another question. My experience has been that the decision is based partially on facts, partially on emotion and partially on a person's view of their future.
As in so much of life, there are no hard and fast rules to determine if you are a candidate for bankruptcy. Everyone's financial/emotional/future situation is different and one person with $40,000 in debt who can sleep at night and sees great future opportunities for themselves may be able to do what it takes to pay it off. On the other hand, another person with the same amount of debt may be bouncing off walls and feel their future is hopeless under the present set of circumstances and have no other choice than to declare bankruptcy.
A last word, from my own experience. Seeking to solve problems through the courts rarely produces a satisfying result. So if you go ahead, expect to get rid of your debts, but not to walk away feeling like a winner. I encourage you to do your homework and seek professional advice. Good luck!