Trying to Invoke method: EndGame.gm.End couldn't be called.

i want to reastart the game in 2 sec dealy and is give me a erorr.
this is my code

public class EndGame : MonoBehaviour
{
    public GameMengement gm;
    public GameObject blood;
    


    private void OnTriggerEnter2D(Collider2D col)
    {
        if(col.tag == "Obstcle")
        {
            Instantiate(blood, transform.position, Quaternion.identity);
            Invoke("gm.End", 2f);
        }    
    }
  

}

It would probably be better to use a coroutine for this case.

IEnumerator EndGame(float wait)
{
    yield return new WaitForSeconds(wait);
    gm.End();
}
private void OnTriggerEnter2D(Collider2D collision)
{
     StartCoroutine(EndGame(2f));        
}