Why is it bad to kill people?
Killing people is considered bad because it is a violation of human rights and the fundamental value of human life. Every individual has the right to life, liberty, and security of person, as recognized by the Universal Declaration of Human Rights. Taking someone's life without justification is a serious crime and is punishable by law.

Furthermore, killing someone can cause immense harm not only to the victim but also to their loved ones and society as a whole. It creates fear, anger, and sadness, and can lead to revenge, retaliation, and social unrest. Killing people can also have long-lasting psychological and emotional effects on the perpetrator, including guilt, remorse, and trauma.

In general, killing people is considered to be morally wrong and violates the basic principles of empathy, compassion, and respect for others. Society has developed laws and social norms that prohibit and condemn killing, in order to protect individuals and maintain social order.
Are there some circumstances where it's okay to kill people? What if there's a person coming at me with a knife? Or what about if a guy assaulted by daughter? What if the person is a pedophile and is actively looking to harm children?
There are absolutely circumstance where your actions result in the death of of another.
If you feel that your life is in danger from another, you have the right (and I would say the duty) to defend yourself up to and including ending the life of the person who is endangering you.
This includes defending yourself, your loved ones, even strangers.