How to delete an instantiated GameObject

I’m developing a board game that operates on a grid layout. In order to move, the gameobject should re-instantiate itself in the new position (for example, if you move up, the gameobject is re-instantiated in the y+1 position and the previous gameobject, referring to your previous position, should be deleted). My question is, how do I delete the object in the previous position?

My method currently looks like this:

public void move(String direction)
{
    if (direction.Equals("up")) {
        playerPosition.y += 1;
        Destroy(furbot, 0f);
        Instantiate(furbot, playerPosition, Quaternion.identity);
    }
}

Currently, the new position is displayed correctly, but the clones in the previous positions are not deleted.

Try this…

public void move(String direction)
{
    if (direction.Equals("up")) {
        playerPosition.y += 1;
        GameObject newFurbot = Instantiate(furbot, playerPosition, Quaternion.identity);
        Destroy(furbot);
        furbot = newFurbot;
    }
}

change your script to :

     public void move(String direction)
     {
         if (direction.Equals("up")) {
             playerPosition.y += 1;
             Destroy(furbot, 0f);
           Gameobject a =   Instantiate(furbot, playerPosition, Quaternion.identity);
           Destroy(a);
         }
     }