The cube can only move in the direction indicated on it. The cube can leave the puzzle if there is no other cube in its path, otherwise it will return to its place. The number of cubes that need to be released to complete the level is indicated on the screen.
The A, S, D, W keys control the puzzle (turns in the horizontal and vertical directions). Left-click on the cube you have selected.