A foil is a character who provides a contrast to another character, thus intensifying the impact of that other character. In "Macbeth" Banquo and Macduff are foils for the ambitious and tyrannical Macbeth.
For instance, in Act I, scene iii, the witches appear to Banquo and Macbeth, but while Macbeth seems fascinated by the predictions of the witches, Banquo expresses doubt:
But 'tis strange:/And oftentimes, to win us to our harm/ The instruments of darkness tell us truths,/Win us with honest trifles to betray 's/In deepest consequence. (ll.122-126)
Banquo's skepticism about the predictions of the witches shows him to be a virtuous man, while Macbeth believes the witches so much that he takes action to effect these predictions. While Banquo displays valor in battle, the murderous Macbeth has none.
Another foil to Macbeth, Macduff expresses suspicion of Macbeth's ascension to the throne. In Act II, scene iv, he tells Ross that he will not attend the coronation:
No, cousin, I'll to Fife [his castle]...may you see things well done there./Adieu, Lest our old robes sit easier than our new! (ll.36-39)
And, unlike the murderous Macbeth, who has killed Macduff's family, Macduff seeks vengeance only if he can "feel it like a man"; he refuses to strike down Macbeth's forces, only slaying Macbeth himself that Malcolm's heir may become king:
O, I could play the woman with mine eyes [like Macbeth]And braggart with my tongue! But, gentle heavens,/Cut short all intermission; front to front/Bring thou this fiend of Scotland and myself;/Within my sword's length set him. If he 'scape,/Heaven forgive him too! (ll.230-236)