The key to your question lies in knowing how to identify a direct object or an indirect object. Once that determination is made, then you just need to match person and number. For the third-person direct object pronouns, you also need to concern yourself with 'gender'.
If the object answers the question "WHAT?" or "WHOM?", you're dealing with a direct object. WHAT/WHOM did I visit? -'my mother', 'the children', 'Italy', 'him', 'her', 'the museum', 'it', 'you'. Changing the subject and the verb accordingly, you can apply this simple test to every sentence.
WHAT/WHOM do you see? -'me', 'the sky', the girls', 'them', 'you' (not the same person as the subject)
If the object answers the question "TO WHOM?" or "TO WHAT?", you've got an indirect object on your hands. TO WHAT institution do I address this letter? -'to the bank'. TO WHOM do I write this letter? -'to my mother', 'to the children', 'to her'.
WHAT do I write? -'this letter' (direct object)
TO WHOM do I write it? -'to my mother' (indirect object)
The third-person direct object pronoun '
lo' is used to refer to a male person or a masculine thing. The pronoun '
la' refers to a female person or a feminine thing.
The plural form '
los' refers to a group of males (or a mixed group) or a group of masculine things. The plural form '
las' refers to a group of females or a group of feminine things.
The indirect object pronoun '
le' refers to a person or a thing and '
les', the plural form, refers to a group of persons or a group of things.
When a verb takes
both an indirect object pronoun and a direct object pronoun, and both are in the third person, the two can't appear back-to-back (because that doesn't sound good to the Spanish ear). So, the third-person indirect object pronouns '
le/les' are converted to '
se'. The third-person direct object pronouns remain intact.
In your example, ask the question, "WHOM did I visit?" -'my mother'.
Ah!, 'my mother' is clearly a direct object.
So, now that this is known, simply match person and number. 'Mother' is a third person. For third-person direct object pronouns, you must also match gender. 'Mother' is a female, of course, so "
La visité" is the correct translation.