How can I make an enemy spot the player, move towards them or shoot them?

Hi!

I want to add some AI to the enemies in my game. I want to let them to move towards the player and or shoot them.

How can I do it?

Thank you!