Complex sentence: Direct object answer the question "What?", while the indirect object answers the question "To whom?" or "for whom".
Split into simpler sentences: Direct object answer the question "What?". While the indirect object answers the question "To whom?" or "for whom".