A clause beginning with qui, quae, quod describes a noun (its antecedent); the pronoun takes its gender and number from the antecedent but its case from its own clause.
Forms: sg. qui, quae, quod; cujus (all genders); cui; quem, quam, quod; quo, qua, quo. Pl. qui, quae, quae; quorum, quarum, quorum; quibus; quos, quas, quae; quibus.
Find the antecedent by gender and number, then the pronoun's job inside its own clause: totius mundi, cujus tu pars es "of the whole world, of which you are a part" (cujus is genitive because of pars).
The antecedent is often left out: quae a Monimo dicta sunt "(the things) which were said by Monimus"; qui irascitur "(the man) who is angry". is qui "he who"; id quod "that which, what".
A relative at the start of a sentence or clause can link it to the last one, "and this, and he", and may sit inside a si clause or other clause: quae siquis tenuerit "and if anyone holds to them".
If no antecedent fits, consider other uses: qui can be interrogative ("how?" in qui possit?), and quod can be the conjunction "because, that".