unity – Help with the persecution script Enemy or with the player, endless runner type

Someone should help me with a script or a code to integrate the enemy to chase the player and then slow down in speed, and if the player's speed is reduced, it will catch up, like the normal mechanics of the enemy bag in games of endless runners, I do not know How to wrap my head around her.

I need help.