Welcome Anastasia to the French StackExchange!
As I understand it, your question is about the usage of the relative pronouns with prepositions. In other cases, the usage of the relative pronouns is mostly the same with people and things, except in cases where there is no specific antecedent. In this latter case you use "ce que/qui" to refer to generic things, but have several choices when referring to generic people. Using "celui/celle/ceux/celles que/qui" is structurally the same as using "ce que/qui"; however, you can also just supply a general noun as an antecedent (e.g., les personne que/qui) or use "qui" alone in higher registers in some phrases (e.g. "Qui vivra, verra").
When it comes to using relative pronouns with prepositions, the usage often differs according to whether the pronoun refers to a person or an object. There are special rules when the pronoun would ordinarily be "de" that sometimes require or permit you to use "dont" instead of "de" with a relative pronoun. With general expressions of place or time, it is frequent and maybe normal to replace the relative pronoun and preposition with "où" (i.e., "j'ai visité la région où ils travaillent" or "au moment où il est parti").
Historically, you might expect "que" to be used with prepositions, but this puts it in a stressed position and so "quoi" is phonetically the only option. "Quoi," however, is only used to refer to things that have no inherent gender, such as whole phrases, unnamed concepts, or generic pronouns (e.g., "ce," "cela," or "quelque chose").
For anything with a specific noun antecedent, you can use the appropriate form of "lequel"; however, this form can feel a little "heavy" when used to apply to people. With people, it is common to borrow from the interrogative pronouns and use "qui" with prepositions, except in more formal registers when using "lequel" and its specific gender and number forms can make its reference clearer (e.g., "les personnes avec qui/lesquelles je travaille"). With nouns referring to things, you just use "lequel," since there is no other handy option to choose (e.g., "la table sur laquelle je travaille").
When relative pronouns are used to replace nouns used with "de," I think it is mandatory to replace the pronoun and preposition with "dont" when the meaning indicates "possession" or "attribution" ("la femme dont je connais le fils." With combined prepositions, like "à côté de," or "à cause de" you have to use "duquel, de laquelle, etc." In other cases, I think either "dont" or "duquel" or "qui" (with people) can be used, but perhaps without the same frequency or register ("La femme de qui/de laquelle/dont je parle" or "l'histoire de laquelle/dont je parle").