Trying to get an If statement to run once

My programming knowledge is very minimal and would appreciate help.
I am trying to program when a switch is pressed a counter increments up 1 each time it is pressed, and a servo motor to rotate to 90 degrees pause then stepper motor to travel to different positions.
The counter and stepper motor part of code is working ,but I need the servo to operate only once each time the counter increases., instead or operating every cycle. Thanks



Moderator edit: image inlined

Post your code. Use code tags. Auto-format would be a welcome addition.

but I need the servo to operate only once each time the counter increases

So, move the code that operates the servo to the body of the if statement where you increase the counter.

What code that would be is impossible to determine, since NONE of that code has anything to do with a servo.

A servo is NOT a stepper. A stepper is NOT a servo.