Each of these trays has the same number of cookies on it. How many cookies would you need to eat to leave a cubed number of cookies?
So, you need to eat 9 of the 36 cookies to leave 27 cookies (which is 3 cubed).
The image shows how useful visualisation can be. For the 3 x 3 x 3 you can 'see' the answer is 9, rather than calculate 3 x 4 x 3 = 36 and then find the difference between 36 and 27.