Higher animals, including humans use their brain to control their behavior. The cognitive processes  they use are known as  executive functions (also called cognitive control): They are used to choose what to do, and to also control, if the chosed goals have been achieved.  Some executive functions are basic cognitive processes such as attentional control, cognitive inhibition, inhibitory control, working memory, and cognitive flexibility. Higher-order executive functions require the use of several basic executive functions and include planning and fluid intelligence (for example reasoning and problem-solving).

Executive functions develop over time. They change during lifespan of an individual and can be improved at any time. Similarly, these cognitive processes can be adversely affected by different events.

Tests have been developed to assess the level of these functions. Rating scales can be used.  These tests are usually performed as a part of a larger series of tests, which ain to find neurological and psychiatric disorders.  An example of such a test is the Stroop test. An example of a scale is call Behaviour Rating Inventory of Executive functions.

A counterexample of this is operant and classical conditioning: With these processes, individuals are "taught" to react in a certain way to a given stimulus.  In such a situation, the individual must override the response to a stimulus using executive functions. This is called inhibitory control. The prefrontal cortex is necessary but not solely sufficient for executive functions; other parts of the brain also have a role in mediating inhibitory control.

Certain conditions affect cognitive control. These include addiction, attention deficit hyperactivity disorder, autism, and other central nervous system disorders. Stimulus-driven behavioral responses that are associated with a particular rewarding stimulus tend to dominate one's behavior in an addiction.

Hypothesized role 
The executive system is thought to be heavily involved in handling new situations outside the domain of some of our 'automatic' psychological processes that could be explained by the reproduction of learned schemas or set behaviors. Psychologists Don Norman and Tim Shallice have outlined five types of situations in which routine activation of behavior would not be sufficient for optimal performance:

 Those that involve planning or decision-making
 Those that involve error correction or troubleshooting
 Situations where responses are not well-rehearsed or contain new sequences of actions
 Dangerous or technically difficult situations
 Situations that require the overcoming of a strong habitual response or resisting temptation.

A prepotent response is a response for which immediate reinforcement (positive or negative) is available or has been previously associated with that response. 

Executive functions are often invoked when it is necessary to override prepotent responses that might otherwise be automatically triggered by stimuli in the environment. For example, on being presented with a potentially rewarding stimulus, such as a tasty piece of chocolate cake, a person might have the automatic response to take a bite. However, where such behavior conflicts with internal plans (such as having decided not to eat chocolate cake while on a diet), the executive functions might be engaged to inhibit that response.

Although suppression of these prepotent responses is usually considered adaptive, problems for the development of the individual and the culture arise when feelings of right and wrong are overridden by cultural expectations or when creative impulses are overridden by executive inhibitions.

References

Other websites 
 

 
 The National Center for Learning Disabilities

Cognition
Addiction