How to validate which objects must be destroyed when raycasting?

Hello
I’m using raycast to destroy a GameObject when the player click the button
However when the raycast hits the terrain it is also destroyed here is my code:

 if(Input.GetMouseButtonDown(0)){
Destroy(hit.collider.gameObject);

		}

I want the player can destroy objects but the terrain, Any Idea??

You have to add tag on the object you want to destroy (its on the top of the inspector window). Then you do this:

if(hit.tag == "YourTagText") {
  Destroy(hit.gameObject);
}

It works Thks !!!