A character foil is a character who opposes or differentiates from the main character. Banquo and Macduff both demonstrate fidelity and honor, character traits that Macbeth does not have. Macbeth betrays his people and acts dishonorably.
When Macbeth becomes king, Banquo worries about how he got there.
Thou hast it now: King, Cawdor, Glamis, all,
As the weird women promised, and I fear
Thou play'dst most foully for't… (Act 3, Scene 1)
The fact that Banquo acknowledges the witches and also disapproves demonstrates how differently the two men reacted to the prophecies. Banquo was prophesied too, but he did not act on it. In fact, he tried to convince Macbeth to ignore it. He was more concerned with his responsibilities as a loyal soldier. As a result, Shakespeare ensures that we approve of Banquo, and do not have sympathy for Macbeth
Malcolm also serves as a foil because he acts honorably. Even though his father is murdered, he does not rush to judgment. Instead of trying to get revenge and kill Macbeth, he goes to England and collects evidence while gathering an army of supporters. He even tries to tempt Macduff into believing he would not be a good king, which Macduff refuses to believe. This builds the audience’s faith in Malcolm, while Macbeth further disgusts us.