wit
be at your wits' end be overwhelmed with difficulties and at a loss as to what to do next.
be frightened (or scared) out of your wits be extremely frightened.
gather (or collect) your wits bring yourself back to a state of equanimity.
1984Geraldine McCaughreanThe Canterbury Tales Poor old man, he was too astonished to speak. And before he could collect his wits, he was sitting at table…with his lord on one side and his daughter on the other.
have (or keep) your wits about you be constantly alert and vigilant.
live by your wits earn money by clever and sometimes dishonest means, having no regular occupation.
pit your wits against compete with someone or something.
2013Daily Telegraph Do you know your Elizabeth from your Anne? Pit your wits against our Royal baby quiz and collect your score at the end.