I went to court recently and hope what I've been through helps you.
It all depends on your offense. An infraction is not a serious offense, so take it easy. The traffic court is a friendly place, it is not a criminal court afterall.
At the court, you will be briefed by a court officer on what to do prior to the court proceedings. He/She will explain to you on what you will have to do and how you can plead to your charge.
In summary, you have 3 choices. (1) Guilty (2) Not Guilty (3) No Contest. If you take 1, the judge will let you know on the spot what your penalty is. 3 is the same as 1 as far as I understand except that you are not waiving all rights to the charge (you gotta find out details on that).
2 means that you want to contest the charge and that is normally what you should do. You will then be given the option to do a Trial by Declaration (for California only) ...meaning you write in to defend your case with all supporting documents etc. and the cop does the same. The judge will then make a decision based on the supporting
facts (not sick grandma story). As far as I know, some people get lucky at this point when a cop doesn't submit his side of the story. In that case, you win.
The good thing about TBD is that if you lose, you still have another chance to go to court to defend your case. At that time, do hire a lawyer to defend you (you don't need to show up in court, that's what you pay the lawyer for), otherwise you will simply be wasting your time if you try to come up with some story. Hopefully, you don't have to go through all these.
Here's some info that may arm you with more knowledge before appearing in court:
http://www.courtinfo.ca.gov/selfhelp/traffic/info.htm