how do i replace delay with millis in this code

Anvay:
yes . i saw the code but couldnt understand

Save the millis() value at the time that you move the servo to the next position and increment the position variable. Then, each time through loop(), check whether the required wait period has elapsed by subtracting the start time from the millis() value now. If the period has elapsed then move the servo to the next position, update the position variable and save the start time again.

If the period has not elapsed then go round loop() again, perhaps taking other actions and/or reading inputs, but don't block the free running of loop().

Keep going until you reach the target servo position.