Count the steps a stepper motor takes using the built in Stepper library

Alight, so i want to count the steps a stepper motor takes and display it on the serial monitor. I have tried this code,

#include <NewPing.h>
#include <Stepper.h>
int Steps_per_rev = 32;
int Gear_reduction = 64;
int STEPS = 0;
int Steps_per_output_rev = Steps_per_rev * Gear_reduction;
NewPing sonar (7,6,50);
Stepper steppermotor(Steps_per_rev, 8, 10, 9, 11);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);

}

void loop() {
// put your main code here, to run repeatedly:
//int distance = sonar.ping_cm();
// Serial.print(distance);
//Serial.println(" cm");
steppermotor.setSpeed(700);
int StepsRequired = 1;
STEPS = STEPS + 1;
steppermotor.step(StepsRequired);
Serial.println(STEPS);
}

When i run this, the numbers in the serial monitor just start blazing of and im pretty sure its not correct.
Is their anyway to fix this?

It may be that you have set the speed higher than your stepper can support. If you have the speed set too high then the stepper will miss steps.

If you know how many steps per revolution your stepper has, you can check it by running a simple sketch to turn the stepper the number of steps for one revolution at your set speed. If you find that the stepper turned less than one revolution, then you know the speed is too high.

Note: Some of the "Gear Reduction of 64" motors (like the popular 28BYJ-48) DON'T reduce by exactly 64.

the numbers in the serial monitor just start blazing of and im pretty sure its not correct.

By "blazing of " do you mean "blazing off" and does that mean they are printed very rapidly?

If so then that is what you would expect. If you want to slow things down so you can see these numbers then add a delay just after the print. This will also slow the motor down as indeed does actually printing out the number of steps.