Sometimes when you get pulled over, you are going to get a ticket no matter what happens. Small towns with speed trap reps & state patrols that only do traffic are the worst for this.
Being polite is absolutely the key. I am not saying you have to admit to anything you didn't do, or kiss buttocks, or anything like that. Just plain old business-level politeness. And if you are dead to rights guilty, as noted above, being polite & apologetic & not lying your butt off can work wonders. Lying when you are caught red-handed usually assures your ticket.
Never tell the cop you are going to fight it or see them in court. You just assured that the officer will take better notes on the tickets.
If you have a suspended O.L., no insurance, a record a mile long, etc... do not be surprised if you get a ticket no matter what. I mean, c'mon.
Do not believe the old saw that you should take it to court, the cop may not show up.
Most cops make good $$$ to go to court, and are severely punished if they missed it. For example, if I went to court off-duty, but on a work day, I got 3 hours of OT even if I was there for 5 minutes ( very common-long enough for the prosecutor to play Monty Hall & I was gone.) If I went on a day off, I got 7 hours of OT no matter how long I was there. 7 hours of O.T. was $330.75 at the end of my career. Still think I was going to miss court???

In either case, it went to O.T. on the clock after 2 hours. I was never there that long for traffic. On the other side, an unexcused absence from a court appearence was a 1 day suspension w/o pay. That would have been a loss of $252 for me. Still think I was going to miss court???
Often showing up at the court date on the ticket & trying to do a little of your own plea bargaining with the prosecutor is to your advantage. You may be able to get a fine but no points, or just court costs, etc... The issuing officer won't be there, just you & the prosecutor before the judge. In most areas you have to show up at this appearence & enter a plea of not guilty to get a trial date. This varies from place to place, but the bigger the court system, the more likely that they will deal with you to streamline the process.
Some jokers want to sell you a book that tells you these things. Here they are for free. Take it or leave it. Your actual mileage may vary.