Direct and indirect objects function exactly the same in Latin and English but Latin inflections identify them as opposed to word order or prepositions. Recall that Latin lacks prepositions so the Latin student must supply them where appropriate. For example:
Caesar librum amavit (Caesar loved the book)
Caesar (subject) is the doer of the action (amavit) and the receiver of the action (librum), the direct object, is the direct receiver of the action from the verb. Direct objects can be identified with the accusative case in Latin. Whenever the accusative is encountered, check to see whether it is functioning as a direct object in a Latin sentence. Unfortunately, the accusative case is also used for other purposes so not all words in the accusative are direct objects.
Indirect objects are indicated with the dative case with the need to supply the word “to" or “for" when translating from Latin to English. For example:
Puer puellae rosam dat (The boy is giving a rose to the girl)
Puer (subject) is the doer of the action (dat), rosam (direct object) is directly receiving the action, and puellae (indirect object) is the receiver of the action through the preposition “to." Notice that the direct object is in the accusative case and the indirect object is in the dative as expected. Like the accusative case, the dative is also used for other purposes so not all words in the dative are indirect objects.