You need to use dc-dc step-down converter for the controller, someone like this dc-dc step-down
But it is recommended to use a separate power supply for the controller. Otherwise, there may be glitches or reboots. Stepper motors can sometimes consume a lot of power.
The ESP board uses 3.3v if connected to pin 3.3v - this option is the most efficient. But you can also use 5v for pover on USB or pin 5v