Not matter how intelligent you are, you will still say and do stupid things to the extent that your mind is not cool. Only in a state of mindcoolness, unperturbed by distracting thoughts and emotions, can you access the full capacity of your intelligence.
One prominent emotion that diminishes intelligence is anxiety, and it does so by restricting working memory capacity, which we need for processing information using complex cognitive operations, that is, for all tasks we typically associate with intelligence.
A potential, though controversial, underlying mechanism is the filtering of irrelevant information via inhibitory control over attention: when your working memory is occupied by anxious thoughts and worries, it processes information that is irrelevant to the task you’re trying to accomplish, leading you to perform worse—to be stupider—than if your mind were cool, enabling you to pay attention only to what really matters.