chew a tiny bit of it is the best way to detect grit, removing it though is probably impossible

you can filter out other crap though

if you want to filter it, break the hash up and put it in some luke warm water and stir it, resin will sink along with any grit, glass any other fillers like waxs or polish will float or be suspended, let it sit for a while and then remove the water and dry out the hash.

look around for better guides