door lock with Arduino and a servo

how do I do it most easily?

If the servo starts at 0, and rotates to 180(ish) to unlock:

    lockServo.write(180);
    delay(howeverLongYouWant);
    lockServo.write(0);

If the servo starts at 180, and rotates to 0 to unlock, swap the first and third lines.