I am learning to replace both the direct and indirect objects with the corresponding direct and indirect object pronouns and then rephrasing the sentence. However I am having a hard time identifying the objects and then replacing them to form a structured sentence. Can someone teach me the rule by using the following sentence as the example?

Ella prepara las brochetas con pollo para Arturo.
Identifying the objects:

A direct object is a noun or pronoun that tells what or whom the subject is acting on. It receives the action of a verb.

To determine the direct object, ask the questions What? or Whom? about the verb. The answer is the direct object.

She saw a cat --> what did she see? “a cat” is the direct object.

She met an old man --> whom did she meet? “an old man” is the direct object.

An indirect object is a noun or pronoun that tells “to whom” or “for whom” the subject is doing something; it refers only to people or something considered as a person (for example mythological beings, pets, etc.). The indirect object identifies to or for whom or what the action of the verb is performed. It is the noun or pronoun for which the action is done. An indirect object is usually the recipient or the beneficiary of the action.

To determine the indirect object, ask to whom?, to what?, for whom?, or for what? about the subject and verb. The answer is the indirect object.

Peter gave Mary a coin --> to whom did she give a coin? “Mary” is the indirect object.

Peter gave Mary a coin --> what did Peter give Mary? “a coin” is the direct object.

Replacing the objects:

Direct and indirect object pronouns are usually but not always placed before the verb in Spanish:

María envió una carta a su hijo --> María la envió a su hijo.

María envió una carta a su hijo --> María le envió una carta.

When there is a direct object pronoun and an indirect object pronoun, the indirect object pronoun (usually a person) precedes the direct object pronoun (usually a thing):

(direct objects are in bold type and indirect objects are underlined)

Eva envió una carta a su hijo --> Eva se la envió. ("le" becomes "se" before another pronoun starting with "l").

Dieron un regalo a Carlos --> Se lo dieron.

Hicieron muchas preguntas a la profesora --> Se las hicieron.

Me dio las gracias --> Me las dio.

Ella te explicó el problema --> Ella te lo explicó.

Digo la verdad a mis amigos --> Se la digo.

Digo mentiras a mi amiga --> Se las digo.

and finally

Ella prepara las brochetas con pollo para Arturo --> Ella se las prepara.

PS.: If you need more information, please ask again.
Thank you so much for your help. I have written a few sentences with direct and indirect pronouns. Please let me know if there are any mistakes.

1. Mandaron la invitación a última hora, a nosotros.
_Nos la mandaron a última hora._

2. Raquel envió una postal a los chicos Ruiz.
_Raquel se los envió._

3. Ella prepara las brochetas con pollo para Arturo.
_Ella se las prepara._

4. Ellos no compran las revistas para ti.
_Ellos no te las._

5. Cirilo dio a Raquel la dirección de Rosario, en la estancia.
_Cirilo se la dio, en la estancia._

6. ¿Puedes comprar frutas frescas para nosotros?
_¿Nos las comprar?_

7. En cada capítulo Raquel resume (sums up) los eventos para vosotros.
_En cada capítulo se los resume._

8. Angel escribió una larga carta a Héctor, no escribió la carta para Arturo.

_Ángel se la escribió, no se la escribió._

9. Arturo va a regalar una chaqueta de cuero a Raquel.
_Arturo se la va a regalar._
2. Raquel se la envió. (se=a los chicos Ruiz –Indirect Object-; la=una postal –Direct Object-)

6. ¿Nos las puedes comprar? / ¿Puedes comprárnoslas?

(Where an infinitive or gerund follows another verb, you can put the pronoun either at the end of the infinitive or gerund forming one word or before the other verb)

7. En cada capítulo os los resume. (vosotros -->os–used mainly in Spain-)
En cada capítulo os los resume. (vosotros -->os–used mainly in Spain-)

Is os the only replacement for vosotros or is there a different one in Latin America?
Is os the only replacement for vosotros or is there a different one in Latin America?

In Latin America they say ustedes (formally and informally). In Spain we say ustedes (formally) and vosotros (informally). That is, the plural of both and usted is ustedes in Latin America. In Spain the plural of is vosotros.

As os is the object pronoun for vosotros, it is not used in Latin America.

Talking to children: ustedes se ríen (Latin America) / vosotros os reís (Spain).

Talking to aduts you have never met before: ustedes se ríen (everywhere).
I see. The sentence however said the word vosotros. So I should still replace that with os, right ? and not with se (since se is used for ustedes)? I am sorry if I am being a bother but it is critical for me to understand these concepts for my exam that is coming up soon.
Os is the object pronoun for vosotros and se is the object pronoun for ustedes. That is the correct use.
huyoOs is the object pronoun for vosotros and se is the object pronoun for ustedes. That is the correct use.
Thank you for clarifying.