Resistor overheats

Anyway, the better way to wire a button to an Arduino is to wire it between your selected pin and ground and use the built in pull-up resistor e.g.: pinMode(2, INPUT_PULLUP);
That way you don’t need the “10k” resistor.
However, you have to invert the logic in your sketch because the pin is now “LOW” if the button is pressed.
Incidentally, What colors do you see on the resistor?