I am supposed you are using unipolar stepper motor which has 6 pins, so 2 of them is common. If you want to rotate it for one direction find the not common pins, there are 4 you have to give pulse sequence like this
1000
0100
0010
0001
if you want to change direction, get previous sequence bottom to top,
0001
0010
0100
1000
if you are using stepper motor of different type, same principle is there. Hope this diagram will help to find out pins of motor.
View attachment 81150
image from
**broken link removed**
Also try this it will help you
https://www.stepperworld.com/Tutorials/pgUnipolarTutorial.htm Thanks.