How To Select Single Object From All Objects We Found Whit Tag?

So I’m create the code who find and delete every game object whit specific tag…

// This code destroy all of Game objects whit “Cube” tag even if you put this 3 line in start
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
foreach (GameObject Cubes in GameObject.FindGameObjectsWithTag(“Cube”))
{
Destroy(Cubes);
}

How can I change the code to just destroy one of the founded game objects?

If you want to destroy one active game object with the tag “Cube”, you can do this.

GameObject cube = GameObject.FindWithTag("Cube");
If (cube != null) {
    Destroy(cube);
}