lose your marbles
lose (one's) marbles
To be or become mentally deficient, incompetent, or deranged; to become of unsound mind. My poor grandmother started losing her marbles after she had a stroke. I've been so sleep deprived lately that it feels like I've lost my marbles!
lose your marblesINFORMAL
If you lose your marbles, you become crazy. At 83 I haven't lost my marbles and my memory is, thank God, as clear as it ever was. People are talking about him as if he's lost his marbles. Note: You can also say that someone has all their marbles, meaning that they are not crazy. He's in his eighties but he clearly still has all his marbles.
lose your marblesgo insane; become irrational or senile. informal
Marbles as a term for ‘a person's mental faculties’ probably originated as early 20th-century American slang. The underlying reference is apparently to the children's game played with multicoloured glass balls.
1998 Spectator At least, that is how I recall the event, but I am losing my marbles.