Keyword 'void' cannot be used in this context, cant figure out what to do

I am using visual studio, giving coding another shot and following a tutorial on a tower defense. Trying to code the enemy to go to the first waypoint then to the next.

using UnityEngine;
using System.Collections;

public class Enemy : MonoBehaviour {

    public float speed = 10f;

    private Transform target;
    private int wavepointIndex = 0;
    //Target to the first point
    void Start ()
    {
        target = Waypoints.points[0];
    }
    
    void Update()
    {
        // Get the next wavepoint
        Vector3 dir = target.position - transform.position;
        transform.Translate(dir.normalized * speed * Time.deltaTime, Space.World);
        

        //Move torwards it unil it reaches the wavepoint (less than 0.2f < distance)
        if (Vector3.Distance(transform.position, target.position) <= 0.2f)
        {
            GetNextWaypoint();
        }

        //the next wavepoint we are going to get is this one + 1
        void GetNextWaypoint = ()
        {
            //set that wave point as the  target
            if (wavepointIndex >= Waypoints.points.Length - 1)
            {
                Destroy(gameObject);
            }

            wavepointIndex++;
            target = Waypoints.points[wavepointIndex];
        }
        }
       
    }

have 4 errors:
Keyword ‘void’ cannot be used i this context|Line 30
Invalid expression term ‘)’|Line 30
; expected| Line 30
Cannot use local variable ‘GetNextWaypoint’ before it is declared| Line 26

Your void GetNextWaypoint = () method body is within the Update body :wink: