Formal:
* 頑張ってください (ganbatte kudasai): This is the most common and polite way to say "good luck" in formal situations. It literally means "please do your best."
* お元気で (o genki de): This is a more general phrase that means "stay healthy" but can also be used to wish someone good luck in a formal setting.
Informal:
* 頑張って (ganbatte): This is a more casual way to say "good luck," often used with friends and family.
* ファイト (faito): This is a shortened version of "fighting" and is often used to encourage someone before a competition or challenge.
* うまくいくといいね (umaku iku to ii ne): This means "I hope it goes well" and is a more personal way to wish someone good luck.
Specific situations:
* 試験頑張って! (shiken ganbatte!): This means "good luck with your exam!"
* 試合頑張って! (shiai ganbatte!): This means "good luck with your game!"
You can choose the best phrase depending on the context and your relationship with the person you are speaking to.