Stepper Kill Switch

I appologise for my noobishness,
but i'm still on a quite basic level and am not very good with booleans. Could you write a quick example code for me to see how to do it and then i can have a go myself?