Relative pronouns are glue: they join a describing clause onto a sentence so you don't have to say everything twice. The workhorse is que — it covers people AND things, subjects and objects: La chica que canta es mi prima. El libro que leo es nuevo. When you're not sure which one Spanish wants, que is right far more often than not.
After a preposition (con, a, de, para) and a person, Spanish switches to quien — or quienes for more than one person: la amiga con quien estudio, los primos con quienes juego. And when there's no named person or thing at all — just an idea, a 'what' — the glue is lo que: Lo que necesito es tiempo. No entiendo lo que dice.
The debugging round targets the swaps English speakers make: quien pointed at a thing, lo que used after a noun that's already named, plain que after a preposition with a person, and singular quien doing a plural job. Master these three small words and your Spanish sentences suddenly sound grown-up.