If you and someone else jointly owe a debt, bankruptcy can protect you against the debt and against your co-signer. Or if you want, bankruptcy can protect your co-signer.
Filing bankruptcy with or without your spouse affects the protection from creditors each of you receives, and also affects whether you file under Chapter 7 or 13.
Filing bankruptcy with or without your spouse affects the discharge of debts you each receive, and also affects whether you file under Chapter 7 or 13.