void OnCollisionEnter2D(Collision2D collision)
{
Destroy(gameOnject);
}
// Or if you only want it to be destroyed when
// hitting something specific
void OnCollisionEnter2D(Collision2D collision)
{
if(collision.gameObject.tag == "tag")
{
Destroy(gameObject);
}
}