I am very new to Javascript but on similar occasions I use something like:
function OnTriggerEnter (col: Collider)
{
if (col.gameObject.tag == "wall"){
Instantiate(soundEffect, transform.position, transform.rotation); //this will make a sound effect on collision
Destroy(gameObject); //this will destroy the object the script is attached to
}