Literally, "to break one's head"
romperse la cabeza (first-person singular present me rompo la cabeza, first-person singular preterite me rompí la cabeza, past participle roto la cabeza)