Enemies run at you and attack

I have a game that is ALMOST fully finished. I have everything els done, except for the enemy AI. Let’s say I have an MC called “enemy”, and I have the main character MC, and the enemy has to chase the person in the direction they are going (It’s a side scroller) and attack with the “Attack” animation. How do I do this? Thanks!