There are a number of reasons that you can be sued in civil court. If you fail to pay your credit card bill, then often you are served with a lawsuit after about 4-6 months. If you have a home that is sold at a foreclosure sale, then the bank typically sues you on the deficiency. In other words, if you owe $200,000 on the mortgage, and it sells for $160,000 at the foreclosure sale, then the bank typically would sue you on the $40,000 deficiency. The same thing occurs if you have a car repossessed and the dealership resells it at less than what you still owe.
If you are sued, then you need an attorney. You have a very limited amount of time to file an answer, or you will suffer a default judgment. Sometimes, a General Denial Answer is not adequate, and you need to file a Verified Denial. The clerks cannot give you legal advice, so you need to consult with a lawyer
Filing Chapter 7 bankruptcy or Chapter 13 bankruptcy will typically allow you to discharge the debt alleged in the lawsuit.