keep (one's) wits about (one)
To stay calm and rational, especially in times of stress. Luckily, the teacher kept her wits about her and was able to evacuate all of her students from the burning building.
keep one's wits about (one)
Fig. to remain rational when threatened or under stress; to keep one's mind operating in a time of stress. If Jane hadn't kept her wits about her during the fire, things would have been much worse. I could hardly keep my wits about me.
have/keep your ˈwits about you
be/remain quick to think and act in a demanding, difficult or dangerous situation: Mountaineering is dangerous, so you need to keep your wits about you.