How do you figure out the subject and predicate and direct object in a sentence?
He is a famous doctor.
Here --he is a subject.
Then after is=== a famous doctor, it is called predicate.
Here doctor is called an indirect object because all animated things are indirect objects.
But if we write
I write you the explanations smoothly.
Here, you is an indirect object but the explanations ==direct object.
Direct object can be animated/non animated==both.