The straightforward answer is that you can't kill Barney, since he's a fictional character. But if he were a real person, taking his life would obviously land you in prison. So it's a bit of a moot scenario all around.