I'm assuming this traffic ticket is for an offense such as speeding, running a red light, failing to signal before changing lanes, etc. If so, a clean, wrinkle-free, button down shirt and a pair of khakis (or nice jeans with no rips, tears, or stains) should be more than sufficient for a traffic ticket. If you don't have a button down shirt, wear a polo. If the shirt has a collar, it's probably a safe bet. Don't wear a t-shirt. If you have a pair of black or brown leather shoes, wear those. If not, wear your cleanest pair of tennis shoes. A belt can upgrade your look. Lean toward business casual.
If the offense is more serious and you have a lawyer, I'd ask your lawyer for advice on what to wear.