This isn't as difficult as it seems: there are two categories of prepositions which only take one particular case (accusative only or dative only). I find it helpful to learn these in a list then rearrange that list to form a memorable word. For example the main accusative-only prepositions are as follows: Durch Ohne Gegen Wider Um Für (Ohne, Bis). As you can see, this forms the memorable DOGWUF which is easy to remember! The main dative-only prepositions are: Aus Bei Mit Nach Seit Von Zu, which are easy to learn in a list repeated several times. Therefore, the other main prepositions must belong in the dual-case (accusative or dative) category. These are : Hinter An Neben Auf Unter Zwischen Vor In Über. Using these is simple, in a sentence, when movement is implied in the verb, the preposition takes the ACCUSATIVE case, however when there is no implied movement in the sentence, the preposition takes the DATIVE case. For example: Ich bin in der Stadt. VS Ich gehe in die Stadt. As 'Stadt' is a feminine noun the options for accusative and dative are die or der retrospectively. In Ich bin in der Stadt it is implied (in general) that the person is in a set postition somewhere in the town, and there is no focus on movement or changing state.