Well, if you're using Path2D- and PathFollow2D-nodes (as both the title and the tags suggest you do) it's rather simple: all you have to do is translate the player inputs into offsets along the path - either forward or backward.
func _physics_process(_delta):
if Input.is_action_pressed("ui_right"):
$Path2D/PathFollow2D.offset += 1
elif Input.is_action_pressed("ui_left"):
$Path2D/PathFollow2D.offset -= 1
$Player.position = $Path2D/PathFollow2D.position