hold space (at the top left there should be a bar that increases with a number next to it) then release it (higher the number higher the 'damage'), this decreases the 'health' bar of the monster attacking you (top right), once the bar empties they stop 'attacking' you.