>>10993688(just to be clear, I'm by no means a doctor)
From what I understand they decrease or increase the likelihood of a successful synapse occurring. That can be done by many ways, such as making it harder/easier for a neuron to be ready to fire. So depending on whether or not an action is deemed bad/good or unnecessary/necessary, certain neurotransmitters can be released to change the likelihood of certain thoughts (specific patterns of neurons firing) happening.
If the last few parts sounded very vague, it's probably because that is the part that's less understood. Or because I'm very dumb. Hopefully just the former.