Building System on a Grid

Not sure best way to word this. I am looking for a little direction on making a building system similar to Rust. There are a few resources I have seen on here which have helped tremendously but still not there yet. Just to start and wrap my head around this I want to make it so I can spawn a block that snaps to the ground then every block snaps to that block. Any help would be much appreciated. Thanks in advance.