In your Button.Click Event Handler?
Or perhaps in a Method you call from your Event Handler, depending on your taste.
private void button_Click(Object sender, EventArgs e)
{
}
Or, if you like:
private void button_Click(Object sender, EventArgs e)
{
KillProcesses();
}
private void KillProcesses()
{
}
If you need this exact piece of code in multiple Forms or Classes, consider placing it in a seperate Class and making it static (assuming you don't need instance fields to kill processes).