Rack one`s brains

To try hard to think of something or remember something.

I have been racking my brains all day trying to remember the man’s name.