Related words: make heads or tails of, lucubrate over, ponder, rack one's brain, think hard
Related questions:
What is the meaning of 'racking one's brains'?
How to rack one's brain?
How to rack one's brains with a friend?
What do you do when you're trying to figure something out but you can't and?