Ultrasonic HC-SR04 sensor to change stepper motor direction?

Hello, I am working on a project with arduino. I need a program that changes the direction of a stepper motor at a specific different distance every time. I just ordered an HCSR04 ultrasonic sensor that I heard can do that, but I really do not have an idea on how to do it. Can someone tell me or guide me, Please?
Thank you!

Presumably, you have some software that drives the stepper, and you want to integrate rangefinder software into it.
Can you post the code that you've already got, to give us a better idea of how to help you?