AI help Needed

I’ve been working on a fps and right now I’m working on making the enemy ai and I’m following a tutorial, I’ve tried to make it so the enemies move to set points on the map but they don’t . All help is appreciated
here’s my code

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

[RequireComponent(typeof(NavMeshAgent))]
public class enemyNavigation : MonoBehaviour
{

    protected NavMeshAgent Agent;
    protected StateEnum State;
    protected Target[] PotentialTargets;
    protected Target target;
    protected float NextState;

    // Start is called before the first frame update
    void Start()
    {
        Agent = GetComponent<NavMeshAgent>();
        PotentialTargets = FindObjectsOfType<Target>();
        target = PotentialTargets[Random.Range(0, PotentialTargets.Length)];
        State = StateEnum.Run;
    }

    // Update is called once per frame
    void Update()
    {

        Agent.updatePosition = false;
        Agent.updateRotation = false;
        Agent.updateUpAxis = false;

        NextState -= Time.deltaTime;

        switch (State)
        {
            case StateEnum.Run:
                if(Agent.desiredVelocity.magnitude < 0.1f)
                {
                    State = StateEnum.Shoot;
                    NextState = Random.Range(1, 7);
                }
                break;
            case StateEnum.Shoot:
               
               
                if(NextState < 0)
                {
                    State = StateEnum.Run;
                    target = PotentialTargets[Random.Range(0, PotentialTargets.Length)];
                    Agent.SetDestination(target.transform.position);
                }
                break;
        }

        transform.position += Agent.desiredVelocity * Time.deltaTime;
    }
    public enum StateEnum
    {
        Run,
        Shoot
    }
}

if you need any other code just ask for it

Again I say, Debug.Log() is your friend. None of us can set your project up and test it, only you can. You need to get insight into what states are triggering when, so start sprinkling in Debug.Log() statements wherever you are unsure what code is doing.

There are also plenty of waypoint tutorials out there on the YooToobz.