Better way to check, or look for other spaces when placing an object with a ghost template: in a grid system

So, I want to make a better way to check, or look for other spaces when placing an object with a ghost template. Might I add this is inside a grid based system. My current code has all placed objects in a folder, it then loops through that folder and checks the positions of every block that is currently placed, and it returns true if its position is equal to the position of the object I am trying to place. in simpler terms, this just means it loops through everything in the game and makes sure there isnt anything where im trying to place. This is of course very laggy when placing an object, as I’m checking every this time the mouse moves. I thought maybe I could check around the object I am trying to place, and see if any other objects are near, but I have no idea how I would go about that. This is also all inside a local script, and when placing with a “ghost template” sort of object. This code is supposed to stop the player from placing blocks where other blocks are currently placed. I don’t know if making a grid with x and y coords would help. Please give some ideas for what to do if possible.