Grid Based Base Building

Godot Version

4.2.2 3D

Question

i am trying to implement grid based, snap-point (or whatever you call it) building mechanics to my game just like in fallout 4, valheim, rust etc… i need to check if something is on the way or is the item snappable to other snappable item like walls to walls or roof to celling. what would you suggest? how could i implement that i need ideas thank you.