First of all, the stimulus (a change in environment) will cause the receptor in the skin to fire an action potential down the sensory neurone. The sensory neurone then reaches the relay neurone in the CNS (which consists of the brain and the spinal cord), the action potential then leaves the relay neurone and is carried along the motor neurone + to the effector (a gland or a muscle) which will then elicit the appropriate response. This is known as the reflex arc and is an unconcious reaction that you don't think about.