Simple collision detection C# 2D

Hello, i have looked all around the internet looking for answers, but i am a beggininer and dont understand some of the stuff. Could someone help me with some code to detect a simple collision between my character and the environment. If the character collides with the environment then i need my “Loose” menu to pop down, which i already have animations for. I am also going to have the script attached to a manager component i have already

So basically:

If character collides with environment
Loose menu pops down

Thanks, here is some code i have done already:

using UnityEngine;
using System.Collections;

public class IfLoose : MonoBehaviour {

bool AudioListener.pause;
public GameObject looseMenuPanel;
private Animator anim;

void Start () {

	Time.timeScale = 1;
	anim = looseMenuPanel.GetComponent<Animator>();
	anim.enabled = false;
}

public void OnCollisionEnter(Collision collision){

	}

public void Update () {

}

public void PauseGame(){
	anim.enabled = true;
	anim.Play("PauseMenu");
	Time.timeScale = 0;
	AudioListener.pause = true;
	
}

}

HI,
In the method On CollisionEnter method do the following code

public void OnCollisionEnter(Collision collision)
{

StartCoroutine("PauseGame");
 
     }

Your character should have rigidbody and a collider attached. Also if you have added tags ,then you need to check it in CollisionEnter Code as mentioned in the link suggested by Darsh2019. And this script should be added to the player .