The Trojan War was the catalyst that set The Odyssey into motion since it pulled Odysseus away from his kingdom of Ithaka, and beloved Penelope, and into the ten year struggle to win Queen Helen back for Greece.
Odysseus fights the Trojans (who have kidnapped Helen) alongside his fellow Aechans (Greeks) for ten long years until finally, with some inspiration from the gods, he spearheads the idea for the Trojan horse - a giant wooden horse disguised as a gift for the Trojans that hid the Greeks until nightfall and allowed them to attack the unaware Trojans from within their own city walls.
After the war ends (and this is what Homer's The Illiad is concerned with), the trouble really begins for Odysseus, as we know. So, the war not only causes Odysseus to be away from home in the first place but also is the impetus for all his other troubles, as he never properly thanked the gods for helping him to victory in the war, and we know how touchy those gods can be. In Odysseus's case, they heap an additional ten years of suffering and homesickness upon him, as though the war weren't long enough.