Before a noun with a determiner, use “all of.”
This means you can write: “All of the teachers are helpful.”
You should not write: “All of teachers are helpful.”
Before a noun with no determiner, you should use “all”
This means you should write: “All teachers are helpful.”
You should not write: “All of teachers are helpful.”
Note: A determiner is “one of a group of words that begin noun phrases.” They include: a/an, the, my, this, either, several, more, both, all
Further reading: “Practical English Usage,” 4th edition (#147)