The direct object is that object which suffers first from the action depicted by the verb.
To distinguish between direct and indirect objects, you should subject the sentence to a TO or FOR transformation, the word that comes after the verb is the direct object. The indirect object comes next after the TO or FOR.
1. (a) I sent him a gift
(b) I sent a gift to him.
2. (a) I brought you good news.
(b) I brought good news to you.
3. (a) She gave the man a kiss.
(b) She gave a kiss to the man.
4. (a) I bought him a car.
(b) I bought a car for him.