Words and Explanations

Prepositions are little words positioned in front of nouns to tell when, where, how, why etc.:
in the garden (where?)
at night (when?)
with great difficulty (how?)
because of the rain (why?)

So far we've had

ἐν τοῖς ἀγροῖς
ἐν ταῖς Ἀθήναις
ἐν τῷ οἴκῳ
Where? position in (dative)
ὑπὸ τῷ δένδρῷ Where? position under (dative)
εἰς τὸν ἀγρόν Where to? movement into (accusative)
πρὸς τὸν οἶκον Where to? movement towards (accusative)
ἐκ τοῦ ἀγροῦ
ἐκ τοῦ οἴκου
Where from? movement out of (genitive)

In Short:

   position (no movement) dative -ῳ  
   movement towards, into, onto...    accusative    -ον  
   movement away from, out of genitive -ου     

You'll remember best
if you fix one example firmly in your mind, for instance:

  ὑπὸ τῷ δένδρῳ    that's where the slave is asleep
  ἐκ τοῦ ἀγροῦ  those stones must be carried out of the field
  πρὸς τὸν οἶκον  that's where D walks to after the day's work is done