How to solidify sand
Based on your comments, it sounds like you have some sort of colored sand and you want to immobilize it. My suggestion would be some sort of polymer matrix.

There are multiple possibilities, but one of the easiest is polydimethylsiloxane PDMS which is optically clear and pretty easy to work with (i.e., safe). There's the "base" and a curing agent which creates cross linking.

Probably the easiest how-to comes from U. Wisconsin.

If done right (i.e., no air bubbles) you should be able to pour in the PDMS, cure, and have a polymerized matrix around the sand. Then you could cut it up or do whatever needed to see different regions.