Somebody is about to take an exam, run a race, or fight the final boss. Everyone around them says the same word. The subtitle says “do your best!” — which in English sounds faintly like a warning that they might not.
What the verb actually says
がんばる is about persistence, not excellence: to hold on, to keep at it, to not give up. So がんばって is nearer to “hang in there”, “go for it”, “you've got this” than to any instruction about quality. Nobody is being told to perform well; they're being told that someone is behind them.
The grammar is worth noticing: がんばって is just the て-form, and it's a shortened 〜て ください. That's why it can sound warm or blunt depending on how much of the phrase you keep — がんばって ください to a teacher, がんばって to a friend.
The whole family
がんばれ is the imperative — a shout, not a request. It belongs in stadiums and shounen anime, aimed at someone you're cheering for, never at your boss. がんばります is what you say about yourself: “I'll give it a go.” And afterwards, win or lose, comes the kind one: がんばったね — “you worked hard”, which praises the effort and says nothing about the result.

しけん、がんばって!
Good luck in the exam!

がんばります!
I'll give it everything!
When NOT to say it
To someone already worn out — grieving, ill, buried in work — がんばって can land as “try harder”, which is the last thing they need. Japanese has gentler options for that moment: おだいじに (take care of yourself) when someone is unwell, or むりしないで (don't push yourself). Knowing which of the two situations you're in is most of the skill.
