You can break up your movement on your turn, using some of your speed before and after your action. For example, if you have a speed of 30 feet, you can move 10 feet, take your action, and then move 20 feet. - PHB p190
Movement can be spread out over the length of your turn as you wish. You can even move, take an action, move some more, take a bonus action, then move whatever you have left.1
Alternatively, you can aid a friendly creature in attacking a creature within 5 feet of you. You feint, distract the target, or in some other way team up to make your ally's attack more effective. If your ally attacks the target before your next turn, the first attack roll is made with advantage. - PHB p192
Once you've moved up to the target and taken the Help action - created some sort of distraction - you are then free to move away. There is no requirement for you to stay within that 5' range. Whacking somebody, throwing sand in their face, whatever... and then skittering away could be a perfectly functional distraction. You take the action on your turn, and the effects last until somebody takes advantage of it, or your turn comes around again.
By the same token, there is nothing preventing the enemy from moving away from you after you've taken the Help action. That doesn't prevent your allies from taking advantage, either.
It helps to remember that all the actions of everybody involved in an encounter take place within six seconds. More so, for ease of play, they're taken one at a time in sequence, but really they're all taking placing roughly simultaneously - the characters don't stand still, walking around one at a time, waiting until another person has stopped moving. The initiative order and things like Reactions (and Help) is about fractional second timing disrupting the flow.
1As an aside, it's worth noting that some actions can alter how much movement you have in a turn - for instance, Dash is not movement, but changes how much movement you have available. For characters that can Dash
as a bonus action, you could move, do something with your normal action, then decide whether or not to Dash based on the results of that action. In other situations, there may be consequences for movement (like becoming subject to opportunity attacks).