How do you detect if two specific objects are touching.

I am currently making a game in which if the spikes touch the player the player gets destroyed. I looked around other questions and it seemed that people were using code like this:

function Update () {
    function (OnCollisionStay (collision:Collision)){
    	if (collision.collider.tag == "Player"){
    		
    		Destroy(collision.gameObject);
    		};
    };
};

I was going to apply this script to all the objects that destroy the player.
Can I get some help please? I’m very new to this so forgive me if this is incredibly simple.

function (OnCollisionStay (collision:Collision))
{
if (collision.collider.tag == “Player”)
{

   Destroy(collision.gameObject);
 }

}

This Should Work, if not you can check the exact line where is the error. Its seems a simple error.