This is difficult to answer if your mother tongue is English, as there aren't any of those cases in our language. All those words have the same translation: wer, wen and wem all mean who, although wem should be translated into whom.
How can I make this simple...
You will use each one of those depending on their syntactic meaning and on whether they are introduced by a preposition whose nature is either accusative or dative. For example, für will always make the next thing you're saying be accusative, regardless of its syntactic position: Das ist für dich, where dich is the accusative form of du. Other prepositions, such as mit, will make you use dative: Ich fahre mit dem Auto, where dem is the dative form of das. You can find a list of all these prepositions on the Internet.
Now, turning back to cases and syntaxis... You have to bear in mind that a sentence is divided between several possible syntactic cases, which means nothing more than "possible linguistic situations". Nomative refers to sentences using the verb "to be" or sein in this case: Ich bin ein Mann. In this case, you should not use declinations. Accusative refers to sentences usings verbs that imply having a direct object, in other words, something or someone that is directly introduced by the verb, for example: Ich kaufe einen Computer (I buy a computer). In this case, that which is bought is directly introduced by the verb kaufen, there is an unbreakable relationship between the verb "to buy" and that which is bought, and in order to express this relationship, Germans use declinations. This helps Germans understand what is being bought, it helps them to differentiate between several verbs and objects in a same long sentence. Remember that, in accusative sentences, only the masculine form can be declined (der -> den, wer -> wen, ein -> einen), feminine and neutral don't change. Dative refers to the person or object that is indirectly affected by or related to the verb, for example: Ich kaufe ihm einen Computer. As you can see, it's the same sentence we've used before but adding a pronoun: ihm, which means "him". In this case, the person that receives that which is bought must be expressed in dative in German for the same reason, to be able to see and clearly know what is bought and for whom. There is an indirect relationship between the verb "to buy" and the person who receives that which is bought, and it is "indirect" because the verb must have in the first place something that needs to be bought in order for the person to appear in the sentence. You cannot say "I buy for him", "buy" first needs something. Remember the dative makes everything change (der -> dem, das -> dem, die -> der, ein -> einem, eine -> einer, wer -> wem, etc.). Bear in mind that, if you see there is an accusative case in a sentence, it is likely (although not always, not at all) you will have to introduce a dative case, since dative, again, expresses that which is affected or influenced by that which is directly introduced by the verb (kaufen -> Computer -> receiver).
That is why your teacher is probably making you ask yourself was und wer (or wen and wem). Asking with was will almost always lead you to an accusative case: Was kaufst du? Ich kaufe einen Computer.
Now the tricky part is wer, as it can be all three cases (nominative, accusative and dative). But once you know how cases work, it should be straight forward:
Wer ist dein Bruder? Mein Bruder ist der Chef. (Who is your brother? My brother is the boss). Nominative because we're using the verb sein. Nothing changes, no declinations at all.
Wem kaufst du den Computer? Ich kaufe den Computer meinem Bruder. (For whom are you buying the computer? I am buying the computer for my brother). Dative because the brother is influenced or affected by Computer, which is directly introduced by the verb kaufen.
Wen hast du gesehen? Ich habe meinen Bruder gesehen. (Who have you seen? I've seen my brother). Accusative because the verb sehen ("to see") directly introduces that which is seen, in this case, the brother.
I hope this helps you. :)