San Francisco [1] and Los Angeles [2] both shelter embassies and consulates from many countries around the globe. If you should lose your passport or find yourself in some other trouble while visiting California, contact your country’s offices for assistance.
To find an embassy, check www.travel.state.gov [3] for a list of embassies within the state.
Links:
[1] http://www.moon.com/destinations/california/san-francisco-and-the-bay-area
[2] http://www.moon.com/destinations/california/los-angeles-and-orange-county
[3] http://www.travel.state.gov