Here are some examples:
Object of a verb:
* I saw them at the park. (Them is the object of the verb "saw")
* The teacher gave them a quiz. (Them is the object of the verb "gave")
* She helped them with their homework. (Them is the object of the verb "helped")
Object of a preposition:
* I went to the store with them. (Them is the object of the preposition "with")
* He talked about them all day. (Them is the object of the preposition "about")
* She sat next to them. (Them is the object of the preposition "next to")
Important Note: "Them" is never used as the subject of a sentence. The subject is the one performing the action. Instead, use "they" as the subject.
* They are going to the movies. (They is the subject)
* They went to the park. (They is the subject)
Hopefully, this helps clarify when to use "them" in a sentence.