State laws differ for taking a driving course or traffic school to reduce or take care of a ticket. Generally though you must first pay your ticket and get permission from the court to take traffic school.
For example the courts in California state that you should not attend Traffic School prior to paying the bail amount and Traffic School Administrative fees. If you attend prior to payment of the bail amount and said fees, your traffic school completion certificate will not be accepted by the Court.
To find out the exact steps to take traffic school in your state contact the court listed on your citation. You will first want to make certain you qualify and are eligible for the driving course you want to attend.
For information on how the ticket could affect your driving record if traffic school is not an option for you contact your state's Department of Motor Vehicles.