There are lots of second person pronouns in Japanese, and of
course, there are occasions where you are supposed to use them.
I think the reason your teacher advised you to avoid using them
at the beginning is not because you are not supposed to use them
but because it will be difficult for a beginner to pick up the
right one. Rather than making a wild guess and picking the wrong
one, do not use them for the time being until you proceed to an
advanced level and become sure which one to use in which
occasion. That was your teacher's message, I guess. あなた has a
very subtle nuance, and can only be used between certain
relations, contrary to what another answer says. If you use あなた
to your teacher, it would be definitely rude. But that does not
mean that あなた is an impolite form. It actually is an honorific
form, and why it becomes impolite has a complicated reason
behind it. It is true that you often cannot find a pronoun with
the appropriate politeness, and have to call the second person
by the name or by the tit