You can process it like any plant to use it, the main issue you will come across is if the moss is not tropical it will not do great in the tank.
Wash aaa any loose soil and soak the moss in water for 5-10 mins so it absorbs all it can. Then submerge in a 10% bleach bath for 3 - 5 mins. Then rinse thoroughly to remove the bleach. This will hopefully kill any nasties the moss might have.