Test yourself in one second: Ich gehe ___ Arzt. Zum, zur, zu? A German preposition does not just link words, it also picks the case of the word after it. Mit always leads to the Dativ, für always to the Akkusativ. Learn a preposition together with its case as one pair and most case mistakes fade away.
Prepositions fall into four groups. Each has its own question, and the question tells you the group.