There will be a colored pattern shown on the machine. Recreate that pattern using the buttons on the machine. You can choose between timed or normal. If you press a wrong button, the game will be over.
Double-click the flag after each fail.