Destroy a projectile made from a prefab when projectile collides with a solid surface

So, I have my Beam projectile able to destroy enemies. However, I want it to be able to destroy itself when it collides with any object, whether it be an enemy, terrain, or any solid object it touches.

public class DestroyBeamProjectile : MonoBehaviour
{
    void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.gameObject.tag == "EnemyBody" || collision.collider.gameObject.tag == "EnemyHead" || collision.collider.gameObject.tag == "Enemy")
        {
            if (collision.collider.gameObject.tag == "EnemyHead")
            {
                Destroy(collision.collider.transform.parent.gameObject);
                Destroy(collision.collider.gameObject);
                GameManager.score += 100;
                Debug.Log(GameManager.score + " points!");
            }
            else if (collision.collider.gameObject.tag == "EnemyBody" || collision.collider.gameObject.tag == "Enemy")
            {
                Destroy(collision.collider.gameObject);
                GameManager.score += 100;
                Debug.Log(GameManager.score + " points!");
            }
        }
    }
}

I have it set to destroy an enemy if it comes in contact with it, but I need it to destroy itself if it comes into contact with any solid object. If this can be done using tags, I would like the script to do that.

first you need to assign the tag, in the ending of the collision void put this
if (collision.collider.gameobject.CompareTag == “the tag you want in a string”)
{
Destroy(this.gameobject);
}

but if you want it to be destroyed regardless of what it collides with, just put this in the ending of the collision void
Destroy(this.gameobject);

The reason im saying put it in the ending is because if you put it in the starting it will destroy the projectile before performing rest of the functions