How to start coroutine after it gets stopped

Hey so im starting a coroutine when i start my game and when there is enough enemies I stop it and then I can click on a button to start spawning enemies again the coroutine wont start can someone help me? here is my script

public void NextWaveButton()
        maxNumberOfEnemies *= 2;
        currentNumberOfEnemies = 0;
        StartCoroutine (es);

    IEnumerator SpawnRandomEnemy()
        WaitForSeconds wait = new WaitForSeconds(spawnInterval);
        while (currentNumberOfEnemies < maxNumberOfEnemies)
            enemiesLeft = maxNumberOfEnemies;
            int enemyIndex = Random.Range(0, enemyPrefabs.Length);
            enemyRandomSpawnPoint = Random.Range(0, spawnPoints.Length);

            GameObject newEnemy = Instantiate(enemyPrefabs[enemyIndex], spawnPoints[enemyRandomSpawnPoint].transform.position, enemyPrefabs[enemyIndex].transform.rotation);
            newEnemy.transform.parent = enemyContainer.transform;
            yield return wait;
        if (currentNumberOfEnemies == maxNumberOfEnemies)
            Debug.Log("Max number of enemies spawned so stopped spawning more enemies");

Are you ever reducing the ‘currentNumberOfEnemies’ variable (presumably when they’re killed)? Otherwise when you re-start the coroutine it might immediately stop again because that variable still says you’re at the maximum number of enemies.