Collision with the ground kills the player using c#(Unity2D)

Im making a 2d game like flappy bird and I’m trying to make when the player collides with the ground it dies but it’s not working here is my code from the script

public class Collider2 : MonoBehaviour {

	void OnCollisionEnter2D(Collision2D coll) {
	Debug.Log("ThisWorks: " + coll.gameObject.tag);
		if (coll.gameObject.tag == "bg ground1")

the script is attached to the player
and both the player and Ground have box colliders
i don’t know why its not working?

Make sure the Box Collider you are using is the BoxCollider2D and the rigidbody is the Rigidbody2D.