Yes/no-questions are formed by putting the verb at the beginning:
Glaubst du an Gott? Do you believe in God?
Interessieren Sie sich für Sport? Are you interested in sport?
With question words
More open-ended questions which contain a verb + preposition expression are constructed in two different ways:
• When referring to things, ideas or concepts, questions are formed by using wo(r) + the relevant preposition:
denken an → Woran denkst du? What are you thinking of?
träumen von → Wovon hast du geträumt? What did you dream of?
Note that the letter -r is added if the preposition starts with a vowel.
• When referring to a person, the question starts with the relevant preposition, followed by the appropriate form of wer ‘who’:
denken an → An wen denkst du? Who(m) are you thinking of?
träumen von → Von wem hast du geträumt? Who(m) did you dream of?
The form of wer depends on the case required by the preposition, hence wen (acc.) and wem (dat.).