Basically, they did what immigrants have done in all places and times in the US. They took the jobs that were too hard or too dirty or too dangerous for non-Chinese to want to do them.
The Chinese were best known for their work on the transcontinental railroads. The Chinese were put to work constructing the hardest and most dangerous sections of railroad, particularly through the mountains of California. They worked in terrible conditions, with many of them dying in various ways.
Chinese also did various sorts of menial labor. They are famous for monopolizing the laundry business in many cities. According to the link below, almost 72% of the Chinese in the US were in the laundry business in 1870.
By doing hard, dangerous, or dirty work, the Chinese immigrants were able to make a living in the face of discrimination.