In English, we use a before words that sound like they begin with consonants.
We saw a book on the table.
There is a spider on your shoulder.
Some words begin with vowels, but when pronounced phonetically, sound like they start with a consonant:
The main character is a unicorn. (YOU-ni-corn)
The third number is a one. (WUHN)
We use an before words that sound like they begin with vowels.
I have an old clock in my living room.
An apple fell out of the tree.
Some words begin with consonants, but when pronounced phonetically, sound like they begin with vowels:
We only have an hour until the train comes. (OW-ur)
The second letter is an F. (EFF)
Was your teacher tricking you? Maybe. It depends on context. If the only word that you learned that used an was apple, then it isn't as bad, because they are trying to prevent confusion. If they stated that out of all words in the English language, the only word that used an was apple, that is definitely wrong and misleading.