Prepositions take specific case(s) – everyone knows that! I found a nice little example to help you remember. (Or at least, an example that will thoroughly confuse you if you forget). Hebrews 2:10:
δι᾽ ὃν τὰ πάντα καὶ δι᾽ οὗ τὰ πάντα
δια + accusative (ὃν): for (causal)
δια + genitive (οὗ): through (modal)
In bringing many sons and daughters to glory, it was fitting that God,
for whom and through whom everything exists,
should make the pioneer of their salvation perfect through what he suffered.
(PS: Warning, more such grammar revision notes coming soon, because I’m doing some revision myself).