This article is from the California Driving (and Surviving) FAQ, by "George J Wu" email@example.com with numerous contributions by others.
It's hard to answer that question generally. Some random suggestions:
-- Pick up a copy of Nolo Press' _Fight_Your_Ticket_ (see the recommended
readings question for ordering information and a review).
-- Read the text of the law that you were cited for. It's usually a CVC
citation, see the question on getting a copy of the California Vehicle
-- In some counties, if you go to court you waive the option to choose
traffic school. See the question on traffic school attendance for more
information. And call the clerk of the court where you got the ticket
to find out what your options are.