MKR 1010 Wifi Transistor 3V+ 5V

Your button is wired incorrectly, if wired as shown your power supply would short out.
Remove the 5V line to the button and enable the pull up resistor on the pin mode call.
If you put a 5V signal into a MKR 1010 you will damage it. The biggest voltage you should put in is 3.3V.
Where is your fly back diode?

What power supply do you have?
What is the current capability of it?