My scene change delay code is not working plz help!!

I have code which should change sccene after delay but its not working plz help

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.SceneManagement;
 
 public class kuolee : MonoBehaviour
 {
      
     public float delayTime = 3;
 
     IEnumerator MyCoroutine(float delayTime)
      {
          yield return new WaitForSeconds(delayTime);
          SceneManager.LoadScene("Level2");
      }
     private void OnTriggerEnter2D(Collider2D collision)
      {
         if(collision.tag == "Player")
         {
             
             StartCoroutine(MyCoroutine(3));
         }
      }
 }

I’m not sure wich part of the code is not working for you.

When checking for the collision, collision.tag will return the tag for THIS gameObject. collision.collider.tag will look for the tag of the object it collided with. (I’m guessing this is the issue here).

Other things to consider (from the documentation) :

Both GameObjects must contain a
Collider component. One must have
Collider.isTrigger enabled, and
contain a Rigidbody. If both
GameObjects have Collider.isTrigger
enabled, no collision happens. The
same applies when both GameObjects do
not have a Rigidbody component.

Also you already defined the value for delayTime, no need to pass it as an attribute.

public class kuolee : MonoBehaviour
{
    public float delayTime = 3f;

    private IEnumerator MyCoroutine()
    {
       yield return new WaitForSeconds(delayTime);
       SceneManager.LoadScene("Level2");
    }
  
    private void OnTriggerEnter2D(Collider2D collision)
    {
      if(collision.collider.tag == "Player")
      {
          StartCoroutine(MyCoroutine);
      }
    }
}