Bankruptcy

I've heard that filing bankruptcy is bad for your credit, but so is not paying your debts. What do I do if I honestly don't have the means to pay off my debt right now and I need credit so is it really wrong to file bankruptcy?