"To which", "by which", "on which" etc [closed]

I have come across the phrases like "to which","for which", "by which", "on which" and so on(using a preposition with a relative pronoun).

e.g. The chair on which the body was found..

Could someone please explain if there's a particular rule to be followed when building/using them?

Can I use any preposition before 'which'? What if I say "The chair which the body was found on"? How would I decide which preposition to be put? Can I use other relative pronouns too?

Thanks in advance.


Wikipedia contains [blended with previous version]:

Relative pronoun as the object of a preposition

A relative pronoun often appears as the object of a preposition. For formal writing or speech any relative pronoun serving as an object must be one that 'takes' the objective case, for example, whom, whose, or which, but usually not who and never that—both who and that usually take the subjective case:

Jack is the boy with whom Jenny fell in love (formal)

Jack built the house in which I was raised (formal)

but not

Jack is the boy with who Jenny fell in love (colloquial; or not okay)

and never

Jack built the house in that I was raised (not okay).

In modern, especially informal, English it is not unusual to move the preposition to the end of the relative clause (as though for an independent clause) while leaving the relative pronoun at the beginning of the clause, or omitting it. Such preposition-stranding (or 'dangling' the preposition) has traditionally been deemed unacceptable by grammarians for formal style. Still, the ‘stranded preposition’ form has been widely used since Old English times, and is normal in colloquial speech. Here is the formal style:

Jack is the boy with whom Jenny fell in love (formal);

but any of the following might be heard in ordinary (including colloquial) speech:

Jack is the boy whom Jenny fell in love with (not formal);

Jack is the boy Jenny fell in love with (not formal);

Jack is the boy who Jenny fell in love with (colloquial);

Jack is the boy that Jenny fell in love with (colloquial).