I know this doesn't help you very much or at all, but when learning to code in any language, it's better to figure out the concepts first and then learn the code that will help you to accomplish it. Asking people how to help your game to function will be a long but fruitless task.
For example, in this case think of it conceptually. Player position has an X position, and the enemy has an X position. The enemy needs to make their X position get closer to the player's X position over time. If you can picture the math and the concept, you'll be fine. To me it sounds like you're asking for help both with concept and with the code itself, and that's no good for anyone.