Which coils should I energise to make my stepper motor hold its position

Hi I am very new to this so please forgive me if this is a dumb question.
I am attempting to motorize the lift of my daughters doll house Christmas present and I have succeeded in that respect but when the up or down button is released the weight of the lift spins the motor back to the bottom. Can I energize some of the coils to make the motor hold its position?
Thank you so much in advance.

int inA1 = 2; // input 1 of the stepper
int inA2 = 4; // input 2 of the stepper
int inB1 = 6; // input 3 of the stepper
int inB2 = 7; // input 4 of the stepper
int switch1a = 8;
int limitswitch1b = 9;
int switch2a = 10;
int limitswitch2b = 11;

int stepDelay = 5; // Delay between steps in milliseconds

void setup() {                
  pinMode(inA1, OUTPUT);     
  pinMode(inA2, OUTPUT);     
  pinMode(inB1, OUTPUT);     
  pinMode(inB2, OUTPUT);     
  pinMode(switch1a, INPUT);
  pinMode(limitswitch1b, INPUT);
  pinMode(switch2a, INPUT);
  pinMode(limitswitch2b, INPUT);
  
}

void step1() {
  digitalWrite(inA1, LOW);   
  digitalWrite(inA2, HIGH);   
  digitalWrite(inB1, HIGH);   
  digitalWrite(inB2, LOW);   
  delay(stepDelay);
  
}
void step2() {
  digitalWrite(inA1, LOW);
  digitalWrite(inA2, HIGH);
  digitalWrite(inB1, LOW);
  digitalWrite(inB2, HIGH);
  delay(stepDelay);
}
void step3() {
  digitalWrite(inA1, HIGH);   
  digitalWrite(inA2, LOW);   
  digitalWrite(inB1, LOW);   
  digitalWrite(inB2, HIGH);
  delay(stepDelay);
}
void step4() {
  digitalWrite(inA1, HIGH);   
  digitalWrite(inA2, LOW);   
  digitalWrite(inB1, HIGH);   
  digitalWrite(inB2, LOW);   
  delay(stepDelay);
}
void stopMotor() {
  digitalWrite(inA1, LOW);   
  digitalWrite(inA2, LOW);   
  digitalWrite(inB1, LOW);   
  digitalWrite(inB2, LOW);   
}

// the loop routine runs over and over again forever:
void loop() {
  if (digitalRead(switch1a) == HIGH && digitalRead(limitswitch1b) == LOW ) {
    step1(); 
    step2();
    step3();
    step4();
  }
  stopMotor();
  
  
  if (digitalRead(switch2a) == HIGH && digitalRead(limitswitch2b) == LOW) {
    step3();
    step2();
    step1();
    step4(); 
  }
  
  stopMotor();
 
}

To hold the last state, the coils must be left energized. Don't call stopMotor().

Thank you sooo much.
I kept that line in because I thought it would stop the motor but obviously it didn't.
Again thank you, my daughters gonna love it.