Operant conditioning, also referred to as instrumental conditioning, is a method of learning that makes use of rewards and punishments as a means of controlling behavior. Operant conditioning is where an association is made between a certain type of behavior and a consequence for that behavior. This consequence might be good or bad on the basis of the action in question.
For example, in a famous experiment by psychologist BF Skinner, lab rats were to press a lever when a green light was turned on, as a consequence of which they receive a food pellet as a reward. However, when they pressed the lever when a red light was turned on, they received a mild electric shock. Repeating this several times made them learn to press the lever when the green light was turned on and avoid the same when the red light was on.
However, operant conditioning is not something that takes place just in experimental settings when training lab animals. It also plays a pretty significant role in everyday learning. Reinforcement (positive or negative) and punishment takes place in natural classroom or therapy settings all the time.
Operant behavior is also known as voluntary behavior, and only voluntary behavior can be conditioned or manipulated. Involuntary behavior, also known as respondent behavior, cannot be conditioned because they are part of our reflexes.