im new in programming.
No one started as an expert.
What you want to do is trivial IF the hardware is all connected correctly.
Read the state of a pin. If it has changed (see the state change detection example), to pressed, do something. If it has changed to released, do something else.
Those somethings are stepping 50 times one way or the other. With the Stepper library, that is stupidly simple.