狠命 functions adverbially before a verb to mean 'with everything you've got.' It is colloquial and physical, often paired with verbs of force:
狠命打 (hit hard),
狠命跑 (run desperately),
狠命掐 (pinch hard). Compare
拼命 (pīnmìng) which is broadly synonymous but slightly more 'risk one's life,' and
死命 (sǐmìng) which adds a stubborn flavor.