Is it lashon hara to talk to others about a particular class in school or teacher (secular) if the teacher is Jewish?
Is one allowed to complain about the class, or warn others not to take the class or warn of difficulty of tests?
Is it lashon hara to talk about groceries, as to give advice to someone not to shop in one place or to shop somewhere else? (Not out of spite, but if one knows the food is not fresh in a particular Jewish owned store.)
The general rule of lashon hara in the question you raise is the intention of the person who wishes to speak.
It is permitted to speak lashon hara when one’s intention is for a to’eles, meaning for a positive, constructive purpose (and not for a ‘negative’ purpose of hurting the store or the person in question), which cannot be achieved without speaking the lashon hara. This is permitted provided that one does not exaggerate (concerning a store, see Chafetz Chaim, Recilus chap. 9).
Therefore, if there is a need to speak about a teacher or a class, in order to warn others about something amiss, this is permitted, provided the conditions above are met.
The same applies to the question of the grocery store, and to complain about a class.
However, one must be vigilant and wary to check thoroughly before speaking about such matters, ensuring that the facts are clear and known first-hand, that there is no other way of averting damage, and that one does not exaggerate.
There is no prohibition of speaking lashon hara about a wicked person, but most secular people today will not fit this definition, and this depends on the personal circumstances of the case. Either way, one should avoid speaking lashon hara even about those to whom the actual prohibition does not apply (see Az Nidberu Vol. 14, no. 69, sec. 4).