arduino crashing everytime on button press

It is not your code it is the way you have wired up your push button. It looks like from the diagram you have not posted that when you push the button you short out the Arduino's power supply.