Is it wracking your brain or racking your brain?
The spelling 'rack' is now used in all senses except for the seaweed called wrack. So it's "rack and ruin," … "racking my brains," and so on. Some other usage guides provide a way of dealing with this question that has a certain brutal charm: just stop using the word wrack.
What does wreck your brain mean?
To rack one's brain is to torture it or to stretch it by thinking very hard. To wrack one's brain would be to wreck it. This might sort of make sense in some figurative uses, but rack is the standard spelling where the phrase means to think very hard.