The cat ate the food. In this sentence the cat is the subject and the food is the object. The subject is the "who" or "what" the sentence is about. The object is the thing receiving the action, in this case, the food was eaten.
The cat gave me the ball. In this sentence the cat is still the subject. The indirect object is me; it is the person or object receiving the direct obj