wrack (one's) brain(s)
To struggle very hard to recall or think of something. (The word "rack" is considered the more correct spelling, though "wrack" has become acceptable through common usage.) I've been wracking my brain, but I still can't remember what Lydia's husband's name is. He wracked his brains all weekend trying to think of a solution to the problem.
wrack (one's) brains
/brain To try hard to remember or think of something.