I immediately thought of tilting at windmills:
From Wikipedia:
Tilting at windmills is an English idiom that means attacking imaginary enemies. The expression is derived from Don Quixote, and the word "tilt" in this context comes from jousting.
The phrase is sometimes used to describe either confrontations where adversaries are incorrectly perceived, or courses of action that are based on misinterpreted or misapplied heroic, romantic, or idealistic justifications. It may also connote an importune, unfounded, and vain effort against adversaries real or imagined.
In other words, if you are tilting at windmills you are putting in a lot of effort toward something either misguided or ineffectual. In other words, it's probably not going to do you any good. (And it might also make you look foolish.)