To be eligible for trial by written declaration, you must have received only a traffic citation or other infraction, your ticket must not be overdue and you must not have been ordered to appear in court.
While some traffic ticket attorney offer services that prepare a written statement that includes your version of the events as well as the legal arguments on your behalf. The downside is that sometimes the officers will be less inclined to deal with your attorney if you lose and then request (as is your right) a trial in person. This issue has come up with truckers ticketed for a violation of vehicle code 22406 on I-5 on the grapevine and sent to Lamont court.
You may want to request a phone consultation with a local attorney before picking the option that is best for you.