Well there are two types of pronouns the direct object (me,te,lo,la,nos,os,los,las) and indirect object (me,te,le,nos,os,les).
The direct object pronoun is the object that directly receives the action of the verb. It also answers the question what? or whom?. An example would be John hits the ball. Hits is the verb and ball is the direct object so, if you used a direct object pronoun for this sentence it would be John la golpea because, ball in Spanish is pelota which is singular feminine word so that's why you use la. Another example is I bought the flowers ( Yo las comprè). The reason you use Las is because flowers is a plural feminine word ( las flores).
For indirect object pronouns you are trying to answer the question of To whom? or For whom?. An example would be He gives the book to Maria. Maria is the indirect object and the book is the direct object. This is how it is written Èl le da el libro a Maria. He gives who the book, Maria gets the book. The upside is most of the time if there is a indirect object then there will be a direct object as well. Yet, there are exceptions so, if you want to say "I told her". You would say "Le dije a ella" because, the word "it" is already assumed in the sentence. There are a few like these but it just takes practice.
Hopefully I didn't confuse you even more and if you have anymore questions or want more examples I'll be glad to help.