Entire textbooks have been written about this question, so keep in mind that this answer will be very simplified.
A neurotransmitter is the basis of all communication in the brain. Our neurons (the nerves in our brains) are not actually connected to each other.
This is actually a good thing, imagine if your nerves were connected, and you cut your finger. There would be a direct line of pain running from your finger to the pain center in your brain, and there would be no way to shut the pain off. But because there are spaces between the nerves, our brain can place endorphins into the spaces (synapses).
Endorphins are the body’s natural painkillers, and they can buffer the transmission of the pain signals between the nerves. If that is not enough, we can take other pain medications (analgesics) to help decrease the pain. They too help block the transmission of pain signals between the nerves.
Therefore, because your neurons do not actually touch each other, they need to send messages to each other in order to communicate. They do this by using neurotransmitters. One neuron sends out neurotransmitters into the synapse between the nerves.
When the neurotransmitters fill that space, they bounce onto the membrane of the next nerve. When this occurs, small electrical charges are generated, and when there are enough charges, an action potential (large charge) is created.
This action potential allows for a message to be sent on to the next neuron. This process repeats itself again and again as the message travels from where it started to where it ends. One major area of current research focuses on how these neurotransmitters are related to the development and maintenance of OCD.
Also being investigated are medications that can boost the workings of neurotransmitters that may have an influence on decreasing OCD.