These are all relative pronouns and are used to link the second part of a sentence to the first part when referring back to something mentioned in the first half.
If what you're referring back to is a person, use QUI to mean WHO. eg. C'est l'homme qui est méchant. If what you're referring back to is an place, use QUI to mean WHICH. eg. C'est la maison qui est belle.
TOP TIP: QUI is usually followed by a verb.
If what you're referring back to is an object, use QUE to mean THAT or WHICH. eg. C'est le sac que j'ai acheté.
TOP TIP: QUE is usually followed by a subject.
DONT is used to mean WHOSE, OF WHICH, OF WHOM, ABOUT WHOM, ABOUT WHICH, FROM WHICH. It is often used when referring back to something spoken about. eg. C'est le film dont elle parle.
TOP TIP: DONT is used with verbs and expressions that come with "de" attached. eg. parler de, avoir besoin de, rencontrer de.