There is no completely fool-proof way of knowing which preposition goes in each of these idiomatic prepositional phrases. They form groups to some extent, but generally speaking, they have to be memorized as individual chunks of language.
All of these use "in", often figuratively, i.e., without literal interiority.
in my prayers in my thoughts in my heart in my drea