How to destroy player when collide with enemy?

I have a game object named Player which has a box collider and a rigidbody2D without kinematic.
I also have a game object named Enemy, which has a circle collider with “is trigger on” and an animation applied to it. I want to know the code to make my player die when it collides with the enemy. It is a 2d game. I am trying to make a game similar to the “Worlds Hardest Game”
This is the code im using

function OnCollisionEnter(myCol: Collision){

 if(myCol.gameObject.name == "Enemy"){
     Destroy(myCol.gameObject);

}
}

I figured it out, I had to put the word 2d infront of the function

You can use :

function OnTriggerEnter (other : Collider )
{
 if (other.CompareTag("Player")
 {
  //Game Over
 }
}

Do note u need to use collider in the OnTriggerEnter params.

public Collider2D player;
public Collider2D enemy;

private void SomeMethod()
{
if (player.IsTouching(enemy))
{
destroy(player, delay in seconds);
}
}