When you want to cheer somebody up or if you simply want somebody to give it their best. Another English equivalent would be "Come on!".
Check out this group of Chinese phrases too. You might find more useful Mandarin phrases. The current Chinese phrase "Try harder" appears in this group