Ich kaufe einen Apfel.
English: I buy an apple.
In German, some verbs need an object in the accusative case (direct object), some need an object in the dative case (indirect object), and some need both. Knowing which case to use is important for correct German sentences.
Use the accusative object for the direct receiver of the action (what or whom). Use the dative object for the indirect receiver (to whom or for whom something is done). Some verbs always use dative, some accusative, and some both.
Ich kaufe einen Apfel.
English: I buy an apple.
Sie hilft ihrem Freund.
English: She helps her friend.
Wir geben dem Kind einen Ball.
English: We give the child a ball.
Kannst du mir das Buch geben?
English: Can you give me the book?
Die Lehrerin erklärt den Schülern die Aufgabe.
English: The teacher explains the task to the students.