Quick answer
¡Suerte!
the everyday version
¡Mucha suerte!
the alternative — see below for when
Which one to use
¡Suerte! alone is the everyday version. Before something difficult, Spanish speakers often say ¡Mucha mierda! — literally “lots of excrement”, the equivalent of “break a leg”, and standard before exams and performances.
All the versions
¡Suerte!Good luck!
¡Mucha suerte!Lots of luck!
¡Que te vaya bien!Hope it goes well!
¡Mucha mierda!Break a leg! — before a performance or exam.
¡Ánimo!You can do it! / Chin up!
Where you are matters
Everywhere. ¡Ánimo! is the one you use when someone is struggling rather than starting.
Check yourself
A friend has an exam in ten minutes. The most natural thing: