The nervous system is composed of the central nervous system (CNS) and peripheral nervous system (PNS). The CNS consists of the brain and spinal cord, which act as the main control centers. The brain is divided into the cerebrum, cerebellum, and brain stem. The PNS connects the CNS to the rest of the body and is composed of nerves and ganglia. It can be subdivided into sensory and motor nerves. Together, the nervous system allows the body to coordinate activities, sense the environment, and produce responses.