How to execute functions simultaneously in this case?

Of course it is. You just have to break down your tasks into small enough increments such that no one taks is late doing what it needs. If your code blocks when a new web request comes in, that won't work. If your stepper motor code blocks until it is completely done, that wont work.

Maybe post your complete code?