Limit switch with Nema 17 and A4988

Anyone know how to stop stepper motor when it running ? , use module A4988

Thank you