There was a huge war in Italy at the time and Machiavelli wanted to give rulers advice on how to rule their countries more efficiently. His trademark phrase in The Prince was that "the ends justifies the means". Meaning, as long as the result is good for country, what you did to achieve that result doesn't matter.