Directing our behavior adequately to current goals requires a trade-off between cognitive flexibility and cognitive stability. In this chapter, empirical data and theories are reviewed which show that this trade-off depends on optimal modulation of frontostriatal circuitry by the major ascending neuromodulatory systems of dopamine, noradrenaline, and acetylcholine. Highlighted are the roles of dopamine in (a) the prefrontal cortex in the stabilization of goal-relevant representations and (b) in the basal ganglia in the flexible updating of those representations. The cognitive neurochemistry of cognitive flexibility is, however, complex, with different forms of flexibility implicating subcortical and/or cortical dopamine, noradrenaline, and/or acetylcholine. The review concludes with a number of open questions raised by attempts to reconcile the different, complementary theories about the neurochemistry of the flexibility-stability trade-off.