Every instance in my educational history I could think of where I was demotivated had something to do with a class or task that I did not succeed or do well in. In some cases I received criticism from the instructor while in others the instructor was not a participant in my working through my failing at a task (in the latter cases, sometimes I wished they had helped me somehow). When the instructor did provide criticism, it was always justified and accurate (i.e., I really did mess up).
One story: in elementary school, I was taking a pottery class and when I went to create a glaze pattern on the pot I had turned, I just dipped it from one bucket of glaze to another without waiting for the earlier coatings to dry. The teacher scolded me for ruining the buckets of glaze. I was mortified and for the rest of the course, the joy of making pottery evaporated and I decided to just get through the course. The thing is, I knew at the time I hadn’t understood the teacher’s instructions and that I didn’t know what I was doing, but I was too embarrassed and shy to say anything and so just plowed forward. And so, even though I felt really bad after the scolding, I knew I had deserved it. In the many years subsequent, the memory of that experience prods me to ask for help if I don’t understand something, even if I feel embarrassed to ask (which happens a lot, to this day). So, while I don’t think I’ve turned a pot since that class, I feel like something good came out of it.
When I think about what could have been done differently with regards to demotivation, part of me feels like my own sensitivity is a big player in it. That is to say, being demotivated is partly due to my reception of failure rather than due to the instructor’s criticism or other factors. In the pottery case, perhaps my teacher could have taken me aside in the class and walked me through what I had done wrong, worked with me on improving my listening to instructions, and encouraged me to ask when I didn’t understand (as well as encourage me what part of my pot did look right). Certainly, this is what I try to do now with my own kids. But, there were other students in the class, I did mess up a load of expensive glaze, and I don’t blame my teacher in any way.