A foil is a character who usually contrasts with the protagonist in order to reveal the character of the protagonist more clearly. Hamlet's father has been murdered, and his ghost has tasked Hamlet with exacting revenge on his murderer (Hamlet's uncle, Claudius). However, Hamlet takes a really long time to achieve his revenge, and lots of innocent (or relatively innocent) people die as a result of his inaction and indecision. Ultimately, he only manages to kill his father's murderer just before he himself dies.
Laertes, on the other hand, learns that his father, Polonius, has been murdered, and he immediately returns to Denmark to avenge his father's death. Where Hamlet drags his feet and takes forever to even come up with some plan, Laertes rushes home, ready to hold his father's killer responsible right away. When he learns that Hamlet is responsible for his father's death, he comes up with a plan to kill the prince. However, this plan is rather dishonorable, especially considering Hamlet's very sincere apology and obvious remorse for his actions concerning Polonius; further, everyone believes Hamlet to be mad—can an insane person truly be held responsible for his actions? Therefore, I'm not sure we can really say that either character's actions are preferable: Hamlet's inaction and Laertes's rash action both result in unnecessary deaths and bloodshed.