There are a few ways of getting rid of pests in drift wood, but as mentioned it depends on what the pests are. You can bake the wood in your oven, you can soak the wood in diluted bleach, you can try hydrogen peroxide, etc. In all cases,you have to rinse the crap out of the wood afterwards to remove both any chemicals as well as whatever "pests" may have died in it as a result of treatment. Also best to then soak the wood for a week or two outside the tank as well just to keep an eye on it.