In many respects, Malcolm is a foil to Macbeth. Where Macbeth is the usurper who has murdered his previous king, Malcolm is the legitimate claimant to the throne. Where Macbeth is bloodthirsty and duplicitous (using murder as a political tool of choice), Malcolm is presented as noble and virtuous in character, possessing the traits that would make for an ideal ruler.
At the same time, however, Malcolm also possesses a pragmatic side to his personality, one that allows him to serve as a foil to his own father, Duncan, as well. While Duncan was, by all respects, a good king, he made the mistake of trusting in the wrong person, a mistake that proved fatal (and disastrous for Scotland). While you could argue that he had every reason to trust in Macbeth, the key fact remains: Malcolm learns from his father's error and is much more cautious in where he places his trust.
After his father's death, Malcolm flees Scotland to go into hiding before raising an army to retake his rightful throne. It is here that Macduff travels to join him, but Malcolm will not blindly place his faith in him; instead, he aims to test Macduff's character through deception, claiming to be unsuited to rule and a potential tyrant in the making while listing various vices that would make him unfit to rule.
By slandering himself in this manner, he can discern the truth of Macduff's own purpose by observing his reaction. When Macduff rejects Malcolm, despairing at his supposed personality, Malcolm knows he can be trusted. Later, Malcolm will also show his cunning in a strictly military context as he orders the trees of Birnam Wood to be used for the purposes of concealment in preparation for their confrontation with Macbeth.
In this respect, his combination of pragmatism and cunning with a fundamentally virtuous disposition makes him an ideal claimant to overthrow Macbeth and restore legitimate monarchy to Scotland.