Any stimulus that represses a behavior. It is important to note that punishment is not the same as negative reinforcement. Is failing a test negative reinforcement or punishment? If it motivates you to study more it is negative reinforcement (i.e., it increases the behavior of studying). However, if you feel that studying is actually hurting your performance (due to, for example, test anxiety) you will perceive that failing the test was due to studying too hard. Next time, you will not study (i.e., decrease your behavior) so that you will not be punished for it. Now you just need to convince your professor that bad grades are actually causing you to study less.