We now would like to have a short look at the logic, even though you will notice that it is the same logic as in English. However, to use the correct form, it is probably a good idea to know which is the correct form and why is it used.
In English - as well as in French, as we will see soon - there is not a difference between something said and something imagined; but there is a difference in the point of time, when the narration or the imagination takes place. We differentiate between the present tenses (to which belong: présent, futur) and the past tenses (to which belong: passé composé, imparfait, passe simple, plus-que-parfait, conditionel) of the introductory clause; this has an effect on the tenses used in the reported speech.
Is the introductory clause in present tense, the reported speech (or thought) is in the same tense(s) as the original ones. Is the introductory clause in a past tense, the reported speech (or thought) has to be transferred to a different tense.