Knock oneself out (doing something)

To make a great effort doing something.

We knocked ourselves out trying to make the party successful.