"A man executes his bestfriend to savr him from an angry mob"
The way the man would execute his bestfriend would be far more humane than what the angry mod would have done. He would be tortured at the hands of the mob instead of just a quick bullett to the back of the head. For example, in "Of Mice and Men" George swiftly takes out Lennie with a pistol bullett to the temple while Lennie is thinking about happy bunnies. If the mob were to have gotten a hold of him it would have been a lot of violence, pain, and horrible thoughts. So instead of dying terrified, he died thinking of sweet bunnies.