Empathy as morality?

I used to think that morality was based off empathy. “Do unto others as you would like done unto yourself”. Meaning every action taken would have to be one that you would also like done to you.

But what about, say, putting someone in prison, or killing someone in self defense? What about going to war with a country e.g. Nazi Germany that was taking over a continent and killing millions of people in concentration camps.

How could you kill or lockup and arrest Hitler or Osama or any person using empathy as a justification when you yourself would NOT like to be locked up or killed?

I’m a total philosophical illiterate and if these questions have been dealt with by any big names in the past then I’d like you to recommend some reading material, because I’m really confused! Thanks.

If you believe they’ll lock up or kill a lot more people if you don’t, you can justify it as the lesser of two evils. If you simplify the problem down to just you and one other person, you exclude the effects of your empathy and your actions from the rest of society, and society is a very significant point of reference for a morality.

Morality’s a complex thing, there are many approaches and many famous thinkers who’ve got themselves involved. I found “Being Good” by Simon Blackburn a good introduction to the main schools of thought; it doesn’t talk down to the reader and doesn’t push any approach in particular. It is a bit short on virtue ethics, and the conclusions are a bit superficial, but that’s why it’s an introduction.