All the information from the environment is detected by the receptors (sense organ) present in the body.
The stimulus received by the receptor is passed on in the form of electrical signals to dendrites of a neuron and then to cyton of the neuron. The impulse then travels along the axon of the neuron.
On reaching the axonal end, it causes the nerve endings to release a chemical which diffuses across a synapse and stimulates the dendrites of adjacent neuron, then to their cell body to be carried along the axon. In this way, the electrical signal reaches the brain or spinal cord. The response from brain (or spinal cord) is similarly passed on to the effector, that undergoes the desired response.