Generate Tile Map with water

How would I go about generating a tile map with 2 tiles: grass, and water. I want it to generate so that it takes into account its neighbors, but I don’t know how.

I made some code heres what it produced:

Here’s the code:
public int Width;
public int Height;
public GameObject Grass;
public GameObject Water;
GameObject LastMadeObject;
public bool clearObjects = true;
static public List objects;
GameObject NewGo;

     // Start is called before the first frame update
     void Start()
     {
         objects = new List<GameObject>();
         GenerateMap();
 
     }
     private void Update()
     {
         if(Input.GetMouseButtonDown(0))
         {
             if(clearObjects)
             {
                 foreach(Transform obj in transform)
                 {
                     Destroy(obj.gameObject);
                 }
             }
             objects = new List<GameObject>();
             GenerateMap();
         }
     }
 
     public void GenerateMap()
     {
 
         for (int x = -Width; x < Width; x++)
         {
             for (int z = -Height; z < Height; z++)
             {
                 
 
                 int y = Random.Range(1, 21);
                 
 
                 
                 if (y <= 10)
                 {
                     if(y <= 3)
                     {
                         NewGo = Instantiate(Grass, new Vector3(x, -2f, z), Quaternion.identity);
                         NewGo.transform.parent = transform;
                     }
                     else
                     {
                         NewGo = Instantiate(Water, new Vector3(x, -2f, z), Quaternion.identity);
                         NewGo.transform.parent = transform;
                     }
                     
                     
                 }
                 if (y >= 11 )
                 {
                     if (objects.Count > 7)
                     {
                         int grass = 0;
                         int water = 0;
 
                         foreach (GameObject obj in objects)
                         {
 
                             float distance = Vector3.Distance(obj.transform.position, new Vector3(x, -2f, z));
 
                             if (distance <= 2f)
                             {
                                 if(obj == Grass)
                                 {
                                     grass++;
                                 }
                                 if (obj == Water)
                                 {
                                     water++;
                                 }
                             }
 
 
                         }
                         if (grass > water)
                         {
                             NewGo = Instantiate(Grass, new Vector3(x, -2f, z), Quaternion.identity);
                             NewGo.transform.parent = transform;
                         }
                         if (grass < water)
                         {
                             NewGo = Instantiate(Water, new Vector3(x, -2f, z), Quaternion.identity);
                             NewGo.transform.parent = transform;
                         }
                         if (grass == water)
                         {
                             NewGo = Instantiate(Grass, new Vector3(x, -2f, z), Quaternion.identity);
                             NewGo.transform.parent = transform;
                         }
                     }
                     else
                     {
                         NewGo = Instantiate(Grass, new Vector3(x, -2f, z), Quaternion.identity);
                         NewGo.transform.parent = transform;
                     }
                     
                 }
                 objects.Add(NewGo);
 
 
             }
         }
     }

If I am clear, you want to generate a map with grass and water, but have the water sort of, clump together?

If that is true, how I would go about it is to first generate every square as grass, then randomly seed 10 or 12 cells as water. Next loop through the whole thing a few times checking each tile if each tile is adjacent to water. If it is, convert that tile to water and move on.

If you then want some “islands” sprinkled in, you can make another pass and randomly turn water tiles back into grass tiles.

I am hardly an expert, but that is the approach I would take.