How to destroy all gameobjects active in hierarchy?

So I just want to know how to destroy not the prefab but all of the gameobjects of that prefab in the hierarchy, it’s like when the player collides with a meteor all of the meteors active in the hierarchy need to be destroyed if the player wants to try again.

Easy way to destroy all specific prefab in scene is to use tag.

You should add specific tag for your prefab and find tag.

        void DestroyPrefabsInScene(string tagName) {
            GameObject[] prefabs = GameObject.FindGameObjectsWithTag(tagName);
            foreach  (GameObject prefab in prefabs)
            {
                Destroy(prefab);
            }
        }