Accelstepper

if you want to use a professional encoder(which are 2000-5000 pulses) , you can find it on old printers. there are 2 encoder disks and 1 encoder slider. they are professional encoder disks and if you want you can use that with your arduino's interrupt pins. im gonna share my codes here ;

/*This sketch counts the pulses of the simple encoder.
Every time the encoder sends a pulse the interrupt is activated at the rising edge of the pulse.
The function count() is called and increments the counter.
The counter variable must be declared as volatile, see the arduino reference.
Otherwise you could miss some of the pulses. The datatype unsigned int gives you a maximum of 65535 pulses.
If this is not enough you can take e. g. unsigned long (4,294,967,295 pulses max.).
When you have more pulses your counter will overflow.

*/
// The pin the encoder is connected
int encoder_in = 2;
int encoder_light = 13;
// Initialize the counter
volatile unsigned int pulses = 0;

void count() {
  // This function is called by the interrupt
  pulses++;
  
}

void setup() {
  pinMode(encoder_in, INPUT);
  pinMode(encoder_light, OUTPUT);
  attachInterrupt(0, count, RISING);
  Serial.begin(9600);
  
  
}

void loop() {
  // Here you can output your counter value e. g. once a second
  //
  //
 if (digitalRead(2)==HIGH) {
 Serial.println("1");

 }
   delay(100);
}