A worker discovered it by accident.
There was a man named James W. Marshall who found gold on January 24, 1848, He saw something shiny in the stream. He had discovered gold unexpectedly while overseeing construction of a sawmill on the American River.
Hope this helped :)
Have a great day