This phenomenon is called the 'jerk reflex' and is controlled by an electrical pathway along the nerves in your body. Once the hot object makes contact or comes close to the skin receptors will pick up the stimulus (thermoreceptors). A transducer will then convert the stimulus into an electrical signal. This signal will travel up a sensory neuron and through the spinal cord via a relay neuron. This sends a signal to a motor neuron which carries the signal to a neuro-muscular junction. This causes the associated muscle to contract creating a jerk response, the muscle is an effector. The jerk protects the individual from pain and damage.