A lawsuit is the result of a disagreement that ends up in court. A long-running feud between neighbors about a flock of chickens and a barking dog might eventually end up as a lawsuit.
If someone files a lawsuit against you, you become a defendant, while they are the plaintiff. Lawsuits are always part of civil law, rather than criminal cases, involving something some kind of financial or personal loss. When you're embroiled in a lawsuit, you'll probably need to hire a lawyer. This legal term dates from the 17th century.