Cognitive flexibility refers to the mental ability to switch between thinking about two different concepts, or to think about multiple concepts simultaneously. It’s a key component of executive function and plays an important role in learning, problem-solving, and adapting to new or unexpected conditions.