How to make an enemy kill the player by shooting projectiles?

So I’m really new to programming and game design and I have an enemy that follows the player around. I just need the enemy to shoot a projectile at the player. I’ve tried loads of things with help from youtube, other forums etc. but can’t find the right thing. The enemy just has to shoot a projectile that kills the player on impact.

Here’s a good start: