Access coroutine within another script and reset it

I have a coroutine that runs on a collision, coded like so within a script ‘A’

	void OnTriggerEnter (Collider col) 
	{
		if (col.collider.tag == "Impulse") 
		{
			impOpticARenderer.renderer.enabled = false;
			impOpticBRenderer.renderer.enabled = false;
			diencephalonRRenderer.renderer.material = glow;
			StartCoroutine(SequentialRenderers());
		}
	}


	public IEnumerator SequentialRenderers()
	{
		yield return new WaitForSeconds (waitTime1);
		hemibrainRightRenderer.renderer.material = glow;
		yield return new WaitForSeconds(waitTime2);
		cerebellumLeftRenderer.renderer.material = glow;
		yield return new WaitForSeconds(waitTime3);
		myencephalonLeftRenderer.renderer.material = glow;
		impFacialARenderer.renderer.enabled = true;
		impFacialBRenderer.renderer.enabled = true;
		impFacial.passedTime = 0f;
		impFacial.speed = 0.2f;

On a separate script ‘B’ I’d now like to access and stop/ reset this coroutine in script A so it’s ready for the next collision, when you hit the spacebar. I’ve so far been unsuccessful. I’ve tried making the coroutine a public method, and writing

void Update () {
	
		if (Input.GetKey(KeyCode.Space)) 
		{
                    StopCoroutine(SequentialRenderer());			
                    impOpticARenderer.renderer.enabled = true;
			impOpticBRenderer.renderer.enabled = true;
			impOptic.speed = 0.8f;
			impOptic.passedTime = 0;

		}

I have a feeling this wouldnt work anyway, as it won’t actually reset the initial coroutine, just pause it. Can anyone offer some advice?

Thanks in advance

The first, you won’t be able to stop coroutine if you start it as in a code. Only StopAllCoroutine() can help. Watch docs about coroutine in more detail. I hope that your scripts of A and B are attached to one GameObject. Below I will a little add your code:

Script A

 void OnTriggerEnter (Collider col) {
  if (col.collider.tag == "Impulse") {
   impOpticARenderer.renderer.enabled = false;
   impOpticBRenderer.renderer.enabled = false;
   diencephalonRRenderer.renderer.material = glow;
   StartCoroutine("SequentialRenderers"); //only string method can be stop
  }
 }

 public IEnumerator SequentialRenderers() {
  yield return new WaitForSeconds (waitTime1);
  //And etc your code ...
 }

 //Function for stop coroutine
 public void myStop() {
  StopCoroutine("SequentialRenderers");
 }

And Script B

 void Update () {
  if (Input.GetKey(KeyCode.Space)) {
   //Find component with script A and stop coroutine
   this.GetComponent<ScriptA>().myStop();
   //Or maybe use full stop: StopAllCoroutines();?
   impOpticARenderer.renderer.enabled = true;
   impOpticBRenderer.renderer.enabled = true;
   impOptic.speed = 0.8f;
   impOptic.passedTime = 0;
  }
 }

I hope that it will help you.