When the green flag is clicked, you will already be within the level editor mode. Whilst within the level editor, use the arrow keys to change your selected material. Press the spacebar to switch to the game player. Here you can test your level. Control your character with the arrow keys, r is for restart, try to get to the goal. You can press the space bar to switch back to the level editor to make changes to the level. You can reset the level by pressing r within the level editor, this will clear everything and give you a blank canvas to work with. Pressing the green flag also resets the level. If this is unwanted, say if you want to continue with your current level after stopping the game, hold down the 'k' key whilst pressing the green flag.
credit to theonlygusti