'To keep your chin up' means to remain positive when things are going wrong.
For example, if someone you know has just failed an exam or a job interview you can say 'keep your chin up'.
Also, if somebody has broken up with a boyfriend/girlfriend you can say 'keep your chin up'.
In sport, if you have just lost a match you can say 'keep your chin up.' Or even if you are in the middle of a game and you are losing you can say it.
Keep your chin up is often shortened to 'chin up.'
Of course the origin of the phrase is that if your chin is up then you are looking forward in a positive way, rather than looking down at the floor when something bad happens.