To repair your credit means regaining the trust of credit card companies. You should be able to prove that you are capable of paying off your debts. But more importantly, you should be able to prove that you have the discipline to handle your finances. You really do not need to totally payoff all your debts in one time. You simply need to pay certain percentage of your debts to gain higher credit scores. You can pay the rest on installment basis. Most credit card companies offer amnesties.
To prevent lower credit score, you should avoid acquiring charge offs in your credit record. Charge offs are deemed uncollectible by the credit company and they are assigned to collection firms. However, you do not necessarily need to wait to sink deep into pile of debts to start repairing your bad credit score. The best way to do it is trough preventive actions and change of attitude. You must never treat your credit cards as unlimited source of purchasing power. Use cash whenever possible and always pay on time. Always live within your means and avoid impulsive buying.