I already know that qui and quod are used as relative pronouns and quis and quid are used in questions.
However, I have noticed that quid and quis are sometimes used in normal sentences and that subjunctive usually comes after them. How do I know which ones to use?
"quid and quis are sometimes used in normal sentences and that subjunctive usually comes after them. "
These are indirect questions.
Allen & Greenough 573-5:
An Indirect Question is any sentence or clause which is introduced by an interrogative word (pronoun, adverb, etc.), and which is itself the subject or object of a verb, or depends on any expression implying uncertainty or doubt.
In grammatical form, exclamatory sentences are not distinguished from interrogative (see the third example below).
An Indirect Question takes its verb in the Subjunctive:
“ quid ipse sentiam expōnam ” (Div. 1.10) , I will explain what I think. [Direct: quid sentiō ?]
id possetne fierī cōnsuluit (id. 1.32), he consulted whether it could be done. [Direct: potestne ?]
“ quam sīs audāx omnēs intellegere potuērunt ” (Rosc. Am. 87) , all could understand how bold you are. [Direct: quam es audāx !]
“ doleam necne doleam nihil interest ” (Tusc. 2.29) , it is of no account whether I suffer or not. [Double question.]
“quaesīvī ā Catilīnā in conventū apud M. Laecam fuisset necne ” (Cat. 2.13) , I asked Catiline whether he had been at the meeting at Marcus Lœca’s or not. [Double question.]
rogat mē quid sentiam, he asks me what I think. [Cf. rogat mē sententiam, he asks me my opinion.]
“hōc dubium est, uter nostrum sit inverēcundior ” (Acad. 2.126) , this is doubtful, which of us two is the less modest.
“incertī quātenus Volerō exercēret victōriam ” (Liv. 2.55) , uncertain how far Volero would push victory. [As if dubitantēs quātenus , etc.]
[*] Note.–An Indirect Question may be the subject of a verb (as in the fourth example), the direct object (as in the first), the secondary object (as in the sixth), an appositive (as in the seventh).
The Sequence of Tenses in Indirect Question is illustrated by the following examples:—
dīcō quid faciam, I tell you what I am doing.
dīcō quid factūrus sim, I tell you what I will (shall) do.
dīcō quid fēcerim, I tell you what I did (have done, was doing).
dīxī quid facerem, I told you what I was doing.
dīxī quid fēcissem, I told you what I had done (had been doing).
dīxī quid factūrus essem, I told you what I would (should) do (was going to do).
dīxī quid factūrus fuissem, I told you what I would (should) have done.
[*] a. Indirect Questions referring to future time take the subjunctive of the First Periphrastic Conjugation:—
“prōspiciō quī concursūs futūrī sint ” (Caecil. 42) , I foresee what throngs there will be. [Direct: quī erunt ?]
“ quid sit futūrum crās, fuge quaerere ” (Hor. Od. 1.9.13) , forbear to ask what will be on the morrow. [Direct: quid erit or futūrum est ?]
“posthāc nōn scrībam ad tē quid factūrus sim, sed quid fēcerim ” (Att. 10.18) , hereafter I shall not write to you what I am going to do, but what I have done. [Direct: quid faciēs (or factūrus eris )? quid fēcistī ?]
[*] Note.–This Periphrastic Future avoids the ambiguity which would be caused by using the Present Subjunctive to refer to future time in such clauses.
[*] b. The Deliberative Subjunctive (§ 444) remains unchanged in an Indirect Question, except sometimes in tense:—
quō mē vertam nesciō; (Clu. 4), I do not know which way to turn. [Direct: quō mē vertam ?]
“neque satis cōnstābat quid agerent ” (B. G. 3.14) , and it was not very clear what they were to do. [Direct: quid agāmus ?]
“nec quisquam satis certum habet, quid aut spēret aut timeat ” (Liv. 22.7.10) , nor is any one well assured what he shall hope or fear. [Here the future participle with sit could not be used.]
incertō quid peterent aut vītārent (id. 28.36.12), since it was doubtful (ablative absolute) what they should seek or shun.
[*] c. Indirect Questions often take the Indicative in early Latin and in poetry:—
vīneam quō in agrō cōnserī oportet sīc observātō; (Cato R. R. 6.4), in what soil a vineyard should be set you must observe thus.