Multiple sclerosis is a neuroinflammatory and neurodegenerative disease commonly associated with cognitive impairment. Understanding brain mechanisms of cognitive impairment in multiple sclerosis is crucial for early diagnosis and developing effective interventions to improve the quality of life in patients. Recent studies indicate that individuals with multiple sclerosis who develop cognitive impairment display changes in network activity in the brain, such as altered transitions between network states (network activity patterns). Particularly, regions within the subcortical network, like the thalamus, show abnormalities early in multiple sclerosis, possibly driving the subsequent changes in the rest of the brain. In this study, we investigated whether there are brain regions specifically involved in driving network changes throughout the brain in multiple sclerosis, and assessed how this relates to cognitive impairment in patients. To this end, we constructed functional brain networks based on resting-state functional MRI data from 102 multiple sclerosis patients and 27 healthy controls. Then we applied network controllability analysis using the most commonly used controllability measures to quantify the effect that brain networks or regions have on driving network changes and state transitions in multiple sclerosis. Furthermore, we compared network controllability changes between patients with different cognitive status. Finally, we tested the reproducibility of our main results using a separate dataset of 95 multiple sclerosis patients and 45 healthy controls. We found significant global, cortical, and subcortical controllability changes in multiple sclerosis, as indicated by increased average controllability while decreased modal controllability and decreased activation energy in patients compared to controls. These changes predominately concentrated in the subcortical network, particularly the thalamus, and were further confirmed in the replication dataset. The controllability changes suggest a compensatory strategy in the brain network of patients, towards preserving fundamental transitions between easy-to-reach network states while relinquishing energetically costly transitions between difficult-to-reach network states. Moreover, while both cognitively impaired and cognitively preserved patients showed controllability changes compared to healthy controls, the thalamus in cognitively impaired patients exhibited a significantly greater increase in average controllability than cognitively preserved patients. This emphasizes the crucial role of the thalamus in the emergence of cognitive impairment in multiple sclerosis. Overall, this study highlights the effect that the subcortical network and the thalamus has on driving network changes across the brain in multiple sclerosis and especially in those cognitively impaired patients, suggesting a possible brain mechanism underpinning cognitive impairment in individuals with multiple sclerosis.