To try very hard to understand or think out something difficult; tire yourself out by thinking.
Пытаться очень напряженно в чем-либо разобраться; ломать голову над чем-то.
It was too hard for him and he beat his brains out trying to get the answer.
Some students are lazy, but others beat their brains and succeed.
That’s the last time I’ll beat my brains out trying to cook a nice dinner for you.
Я в последний раз буду ломать голову, пытаясь приготовить прекрасный ужин для тебя.