Your teachers advice is good so follow it. The list of verbs which take only the dative or only the nominative case is short so you can learn it in a matter of minutes.
In addition to the verbs which take only the dative or only the accusative case you have verbs which can take both kind of objects at once. The good thing is that sentences with these verbs all have the same structure; let me demonstrate it with the verb geben which is the prime example of these kind of verbs:
Ich gebe dem Mann [dative] den Brief [accusative].
By thinking of this example you can find the cases for almost all other verbs with two objects. For example: "I passed the ball to the man" becomes "Ich habe dem Mann den Ball zugespielt."
So far so good. The real problems arise with the verbs which are used with prepositions. Let me give two examples which highlight the absurdity of these verbs. They are both verbs which are used with the preposition in:
sich in dem Mann (dative) täuschen (to be wrong about somebody)
sich in den Mann (accusative) verlieben (to fall in love with somebody)
To me (and many others) there is no logic behind this and the classical wisdom is that they should all be learned by rote. However, there was a recent question about these verbs on this site and some rules of thumb for figuring out the case were given there.