You should read this…
especially the “Defining your physical switch and LED” section, then check that you don’t have a GPIO conflict.
Pete.