How to apply variable to next item in array?

I want to make it to where destination is points[0]. if transform.position == points[1], then destination = points[2]. if the object is at the same position as destination, destination is set to the next point in the points array. How would i do this since the amount of points can varry?

 int p = points.Length;
        if (go && p > 2)
        {
            float step = speed * Time.deltaTime;
            transform.position = Vector3.MoveTowards(transform.position, destination.position, step);

            if (transform.position == destination.position)
            {
                //var cPoint = points[0];
                destination = points[1];
            }
            


        }

I solved the issue by creating an int currentPoints and placing it inside like this. points[currentPoint] and then incrementing it each time the object reached the desination. currentpoints++