Different states have different requirements to obtain a court order name and/or gender marker change.
In California, no physician letter is required to change either your name or gender marker. File the required court forms with the Superior Court of the county in which you live. The gender category options are now male, female, or non-binary. You do not need to attend a court hearing. Once approved, the court order will be mailed to the address you listed on your forms.
You can find CA's court forms online here.
To see what your state requires, check out the National Center for Transgender Equality's Interactive Map, or contact your county court house.