The answer to this question is operant conditioning
operant conditioning refers to behavioral modification technique that impose negative or positive impact toward a certain behavior.
In this type of conditioning, subject will given some sort of reward if the subject do a desired behavior and will given some sort of punishment if the subject did otherwise