banging your head against a brick wall

Banging your head against the wall is not a literal term; rather it is used figuratively to explain how frustrated you are that you are wasting your time to accomplish something that is hopeless. It is also used in other situations where you feel agitated, frustrated or like everything you are attempting to do is pointless because it wont get you anywhere.