make sure there is no overlap when re-enabling objects

I am disabling objects when shot, but the problem is I don’t know how to check if there’s something is in the way (player or enemies etc) when re-enabling the objects.
Right now the objects get re-enabled even if the player is in the way and that’s causing issues.
Here’s my code:

public class BreakingBlocks : MonoBehaviour
{
    public float DestroyTimer = 0F;     /// Wait time before destoying
    public float RespawnTimer = 1.5F;   /// wait time before respawning
    public bool DisableRespawning = false; /// Disable respawning

    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.gameObject.tag == "BreakBlocks")
        {
            Invoke("RandomCube", DestroyTimer);
        }
    }
    void RandomCube()
    {
        gameObject.SetActive(false);
        if (DisableRespawning)
        {
            return;
        }
           Invoke("SpawnCube", RespawnTimer);
    }
    void SpawnCube() // re-enable objects
    {
        gameObject.SetActive(true);
    }

i’d change the gameobjects tag before disabling, then on setactive you first check if the collider intersects with anything, like player or what ever you dont want to be overlapping with. => for example a bunch of grass is ok to be overlapped with, but not a player/enemy so after you setactive(true) you can check with this:

GameObject[] AllCharacters;
bool intersects = false;
var bb = GetComponent<Collider>().bounds; 

for(int i = 0; i<AllCharacters.Length;i++){
  if(bb.Intersects(AllCharacters*.GetComponent<Collider>().bounds)){*

intersects = true;
return;
}
}

if(intersects){
//do something
intersects = false;
}

// Second Solution

void OnCollisionStay/OnTriggerStay(Collision / Collider col){
if(col.transform.tag == “Player” || col.transform.tag == “Enemy”){
//do something
}
}