If you say that someone is barking up the wrong tree, you mean that they are following the wrong course of action because their beliefs or ideas about something are incorrect.
If someone can't see the wood for the trees in British English, or can't see the forest for the trees in American English, they are very involved in the details of something and so they do not notice what is important about the thing as a whole.