What you say to a judge when you get a speeding ticket depends on the traffic court stage. The first court proceeding is usually where you are asked to plead guilty or not guilty. A simple reply suffices. With a guilty plea, you pay the fine. If you plead not guilty, what you say to the judge in the subsequent trial has a bearing on the outcome of your case.
If you need a continuance, it is wise to put the request in writing to the judge at least one week in advance and copy the prosecutor's office. Once the trial begins, the judge usually first listens to the prosecutor's opening statement. If the judge does not ask you for an opening statement, make sure to say "Your honor, I would like to reserve the right to make an opening statement." When you do make your opening statement, state that you are not guilty or that you have a legally justifiable reason for violating a traffic law, such as rushing a heart attack victim to a hospital, according to Nolo, Law for All.
Refer to any witnesses you have and succinctly tell the judge what happened. During the testimony of the officer, you may want to object if the officer testifies to something of which he has no personal knowledge. In this case, say "Objection your honor, the witness has not shown he has personal knowledge." During your closing statement, state that reasonable doubt to your guilt exists and why or that the good reason you had to speed, or run that red light, entitles you to a dismissal.