how do i destroy objects in a radius

new to unity. trying to make a building mode and a destruction mode. the build mode instantiates prefabs (just a cube), i want the destroy mode to destroy these cubes.

here is the code i wrote

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class destroy : MonoBehaviour
{
    
    
    public Transform destroyposition;

    public float destroyradius;
    public Collider[] destructioncolliders;

    public LayerMask destructible;


    public bool destroymode;

    // Start is called before the first frame update
    void Start()
    {
        destructioncolliders = Physics.OverlapSphere(destroyposition.position, destroyradius);
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.X))
        {
            destroymode = !destroymode;
        }
 
        if(destroymode && Input.GetMouseButton(0))
        {
            //code here would destroy all destroyable cubes (set to a specific layer) in a destroyradius around
            //destroyposition. i tried to make it work with a overlapsphere but couldn't figure it out.
        }
    
    }
}

Physics.OverlapSphere returns an array of Colliders. So to destroy the GameObject associated to that Collider, I suggest you use a foreach loop like so

foreach(Collider collider in destructioncolliders)
{
      Destroy(collider.gameObject);
}