Many verbs come with a fixed preposition: warten auf, denken an, sprechen mit. Here the preposition has no meaning of its own (no place, no direction) – it simply belongs to the verb.
The noun after it is the prepositional object. Which case follows is decided by the pair verb + preposition – not by the question "Wo?" or "Wohin?".
So always learn three things together: verb + preposition + case.
warten + auf + accusative → Ich warte auf den Bus.
sprechen + mit + dative → Ich spreche mit dem Arzt.