Ukrainian prepositions can express different meaning depending on the case. The preposition з can be used with the nouns in the Genitive or the Instrumental case. When we answer the question Звідки? (Where from?) and indicate direction, the preposition з is always used with the Genitive case (з міста, з даху).
The preposition до is always used with the Genitive case (до тата, до Львова) and it also indicates the object in the direction of which the movement is directed. In this case we ask Куди? (Where to?).

The preposition complements and reinforces the importance of the case form, clarifying and complicating it. The preposition can be use with one indirect case:

Без (without), біля (near), від (from), для (for), до (to), з-за (із-за) (out of), з-під (from under), проти (against), серед (among) - with the Genitive case only;

Про (about), по (on), під (under), через (through), у (in, at), в (in, at, into, to) - with the Accusative case;

Над (over), під (under), перед (in front of), поза (behind) - with the Accusative and the Instrumental case;

На (on), о (об) (at), по (on, along, around) - with the Accusative and the Locative case.

This is a short list of prepositions just to show you that they are numerous and they can help you to talk about place, time, cause, manner, condition, object, direction etc.

There are simple, complex and compound prepositions:

в, на, з, до, під, над, міжпопід, понад, задля, з-під, посеред, з-попіду зв'язку з, незважаючи на, відповідно до