On your player's Create event create a health variable and set it to an appropriate value. Create a hit variable set to false which will be used to keep track of whether or not the player has been hit.
Create a Collision event and select the enemy.
Place the following code on the Collision object's code.
This code has already been hit. If NOT, it sets hit to true, reduces the player's health by 1, set's the player's colour to red and sets Alarm 0 to 30 frames (half a second). This ensures that the player can only take damage once every 30 frames.
Next, create an Alarm 0 event.
Add this code to the Alarm 0 event. This sets hit to false and sets the player back to the normal colour.