That's the most horrible thing we learned during the 20th century.
That kind of atrocities haven't been perpetrated by 'monsters', 'psychopath' or however we could depict the authors to remove their humanity. They have been done by 'us', normal human, people who thought of themselves as good persons and thought they were fighting for a good cause and doing the right thing.
They way you do it is little by little. You first makes the person feel entitled, you give him reasons to hate the 'enemy', you remove accountability of the executant by using a strict hierarchy and by engineering the killing process. At one point it becomes 'normal' and 'logic' to do what you do.