To change the name listed on a passport only, no physician letter is required. If you received your current passport over 12 months ago, complete form (DS-82) otherwise complete form (DS-5504). Go to the US Passport Help Guide to learn about correct forms to complete and mail in.
To change the gender marker listed on a passport, no physician letter is required (as of June 2021). Complete form (DS-11) and present to the Passport Office in person, even if you would otherwise be eligible to renew by mail. Find a Passport Office near you. You will need to include your court ordered gender marker change. Currently, only Male or Female options are available, though the federal government announced it would be adding X as a gender marker option soon.
For detailed information on how the process works, review the National Center for Transgender Equality's ID Center for more information.