Messages about sensation or movement move through the cells of the nervous system. Let's look at how nerve cells (neurons) work. Inside the neurons, messages travel by a sort of bioelectrical impulse called an action potential. Neurons communicate with each other with chemicals.
Let's say that neuron 1 pick up a sensation of pain. It "fires" and the action potential travels all the way to the end of the neuron. Neurons don't touch each other, but when neuron 1 fires, it sends out chemicals called "neurotransmitters" that travel to the next neuron. The neurotransmitter then causes the next neuron to fire. This is how the pain signal gets sent to the neurons in your brain, which also fire, telling you that you're in pain.
There's a great animation of how this works at:
You will see that when a nerve fires, what's going on is that positively charged sodium ions go into the neurons, then they leave so that it can fire again. This happens all along the neuron. At the end of the neuron, little packets of neurotransmitters are being released into the space between neuron 1 and neuron 2 (the synapse). Then neuron 2 gets the message and can have its own action potential. Sound complicated? This is actually the simplified version, but it's enough to let me answer your question.
Novocaine works by keeping neurons from communicating with each other. Neuron 1 can still send a pain message, but when neuron 2 gets the message, it can't open the ion gates that cause the neuron to fire and send the message through the neuron. So the pain signal never goes to your brain.
Why do you think they inject a small amount of novocaine into a small area? What do you think would happen if they injected it into your vein or let you drink it?
If you are interested in this kind of question, you might be interested in neurobiology, pharmacology, or medicine. Thanks for asking.