How do I stop my player from stopping when I finish clicking

This is my code

  using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class Player : MonoBehaviour
  {
      public float speed = 1.5f;
      private Vector3 target;
      private int click = 1;
  
      void Start()
      {
          target = transform.position;
      }
  
      void Update()
      {
          if (click == 1)
          {
              if (Input.GetMouseButtonDown(0))
              {
                  click = 0;
                  target = Camera.main.ScreenToWorldPoint(Input.mousePosition);
                  target.z = transform.position.z;
                  StartCoroutine(NewClick());
              }
          }
  
          transform.position = Vector3.MoveTowards(transform.position, target, speed * Time.deltaTime);
      }
  
      IEnumerator NewClick()
      {
          yield return new WaitForSeconds(5f);
          click = 1;
      }

when I click the player goes to where it touches, I want that when I click it does not stop and continue in the same direction

Swap your script for this one. If you click it will not lock and when it reaches the target, it will return to the previous position.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
   public float speed = 1.5f;
   public Vector3 target;
   public Vector3 currentPosition;
   public int click = 1;
   public bool noclick = true;

void Start()
{
    currentPosition = transform.position;
    target = transform.position;
}

void Update()
{
    if (click == 1)
    {
        if (Input.GetMouseButtonDown(0))
        {
            if(noclick){
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if(Physics.Raycast(ray,out hit, Mathf.Infinity))
            {
                target = hit.point;
            }
            }
        }

        if(transform.position != target)
        {
            noclick = false;
        }
        if(transform.position == target)
        {
            target = currentPosition;
            noclick = true;
        }

    }

    transform.position = Vector3.MoveTowards(transform.position, target, speed * Time.deltaTime);
}
}

Move infinitely in same direction - Unity Answers
This might help @jafethjuegos