Although the vast majority of teachers are very good, hard-working, caring people who love all children and deserve the utmost respect, there are always a few bad apples, who clearly do not belong in the teaching profession. Teachers can also be bullies and it is something that is often denied and few people ever admit.
Out of about 30 teachers that I had during my years in school, about 3 were bullies themselves. And because of the power dynamic, there is sadly not much that can be done to protect yourself against a bully teacher.
The only thing to do is to be the best student you can possibly be and do it for yourself. Do not try to impress the bullying teacher because if your efforts seem contrived, you will only become an even bigger target for being a try-hard. Just be your sweet, smart, awesome self and hold on to your self-esteem. Never allow yourself to be convinced that you are less than.
Have a wonderful day!