Do you wrack your brain or rack brain?

The correct phrase is "rack your brain." It means to think very hard about something, often to the point of frustration. The word "wrack" is a verb that means to cause ruin or destruction, so it does not make sense in this context.

Brain Nervous System - Related Articles