Idiom: Barking Up The Wrong Tree
Example 1:
Lisa: Did you see that new guy in class? He is SO cute!!
Tina: Oh, you mean James? Yes, he is very handsome! He is my brother's friend.
Lisa: I want to go out on a date with him.
Tina: Lisa, you are barking up the wrong tree!!
Lisa: What do you mean?
Example 2:
News Anchor: The police investigation revealed that Mr. Thompson was not guilty of committing the burglary. It was actually his neighbor who had committed the crime. The police finally realized that they were barking up the wrong tree by accusing Mr. Thompson.
Meaning: To waste your effort pursuing the wrong thing, person or path.