Here’s a good link that names dangerous wood and commonly found safe wood. It also mentions how to treat and prepare the wood.
https://www.beardeddragonsrock.com/wood-for-vivariums.html
Personally, I use a couple of methods, depending on the size of the piece I’m using.
My most recent piece was:
-sprayed down to get rid of the initial dirt and loose pieces
-soaked in a 10% bleach solution
(I imagine F10 cleaner works here too? I don’t have any but it’s used by a lot of reptile keepers I know as a thorough disinfectant. Kills fungi, mold, spores, viruses, bacteria, parasites..)
-scrubbed with a scrubbing brush and rinsed. I do this to get rid of any remaining surface dirt and it really helps to remove bark and brittle pieces.
-steam cleaned. Steam cleaners are really good for cleaning lots of stuff and don’t use dance chemicals. I borrowed my neighbors because I can’t afford one lol
So- obviously that’s not available to everyone. Other methods instead of that are boiling the wood over the stove for a number or hours, or baking it in the oven.
I’ve used the oven technique many times and I like it because it kills anything inside the wood. No bugs are going to crawl out while it’s in the tank after that.
Just make sure not to burn the wood. Keep an eye on it. Also prepare for the house to smell a little funky.