How to destroy parts of a combined mesh in runtime ?

I have a 3d object consisting of models combined into one mesh. How can I selectively destroy parts (models) of the mesh?

you should delete vertices that are related to the part,
in this example when you press w ,it creates a wall,
press A creates a window,
press D will remove the window.

using System.Collections.Generic;
using UnityEngine;

public class Testing : MonoBehaviour
{

// Update is called once per frame
void Update()
{

    if (Input.GetKeyDown(KeyCode.W))
    {

        Mesh m = new Mesh();

        Vector3[] vertices = {
        

         //wall with a whole
        new Vector3(-0.5f,-0.5f,0),
        new Vector3(0.5f,-0.5f,0),
        new Vector3(-0.5f,1.5f,0),
        new Vector3(2.5f,1.5f,0),
        new Vector3(2.5f,-0.5f,0),
        new Vector3(1.5f,-0.5f,0),
        new Vector3(1.5f,0.5f,0),
        new Vector3(0.5f,0.5f,0),
         //wall with a whole

        };
        int[] triangles = { 
        0,2,1,
        1,2,7,
        7,2,3,
        6,7,3,
        4,5,6,
        4,6,3
        
        };

        m.vertices = vertices;
        m.triangles = triangles;
        m.RecalculateNormals();
        GetComponent<MeshFilter>().mesh=m;

    }//create a wall with a whole

    else if (Input.GetKeyDown(KeyCode.A))//add a window to the wall
    {

        
        if (GetComponent<MeshFilter>().mesh.vertices.Length==8)
        {

            Mesh m = GetComponent<MeshFilter>().mesh;

            Vector3[] vertices =new Vector3[m.vertices.Length+4];//for the window we need 4 vertices
            for (int a=0;a<m.vertices.Length;)
            {

                vertices[a] = m.vertices[a];
                a++;
            }

            vertices[m.vertices.Length ] = new Vector3(0.5f, -0.5f,0);
            vertices[m.vertices.Length + 1] = new Vector3(1.5f, -0.5f, 0);
            vertices[m.vertices.Length + 2] = new Vector3(0.5f, 0.5f, 0);
            vertices[m.vertices.Length + 3] = new Vector3(1.5f, 0.5f, 0);

         

            int[] triangles = new int[m.triangles.Length + 6];

            for (int a = 0; a < m.triangles.Length;)
            {

                triangles[a] = m.triangles[a];
                a++;
            }

            triangles[m.triangles.Length ] = 9;
            triangles[m.triangles.Length + 1] = 8;
            triangles[m.triangles.Length + 2] = 10;

            triangles[m.triangles.Length + 3] = 9;
            triangles[m.triangles.Length + 4] = 10;
            triangles[m.triangles.Length + 5] = 11;

            m.Clear();

            m.vertices = vertices;
            m.triangles = triangles;
            m.RecalculateNormals();

            GetComponent<MeshFilter>().mesh = m;
        }
      

    }//create a window

    else if (Input.GetKeyDown(KeyCode.D))
    {

        if (GetComponent<MeshFilter>().mesh.vertices.Length == 12)
        {

            Mesh m = GetComponent<MeshFilter>().mesh;

          
            List<Vector3> vertices = new List<Vector3>();

           

            for (int a=0;a< m.vertices.Length;)
            {

                vertices.Add(m.vertices[a]);
                a++;
            }//now all vertices of the mesh are in here

            //I know vertices 8,9,10,11 are for the window so I delete them

            for (int a=0;a<4;)
            {

                vertices.RemoveAt(8);
                a++;
            }


            Vector3[] vertices2 = new Vector3[vertices.Count];

            for (int a = 0; a < vertices.Count;)
            {
                vertices2[a] = vertices[a];

                a++;
            }

            List<int> triangles = new List<int>();

            for (int a = 0; a < m.triangles.Length;)
            {

                triangles.Add(m.triangles[a]);
                a++;
            }//now you should delete triangles

            for (int a = (8-2)*3; a < m.triangles.Length;)
            {

                triangles.RemoveAt((8 - 2) * 3);
                a++;
            }//deleting triangles

           

            int[] triangles2 = new int[triangles.Count];

            for (int a=0;a< triangles.Count;)
            {
                triangles2[a] = triangles[a];

                a++;
            }
            m.Clear();

            m.vertices = vertices2;
            m.triangles = triangles2;

            GetComponent<MeshFilter>().mesh=m;

        }

    }//remove the window

}

}