The most basic programs use simple commands in a step-by-step order. They're called sequences.
Can you order this sequence so it makes sense?
Great! A different line of action wouldn't make a lot of sense, would it?
Don't we have to unlock the door before we can open it and enter the room before we can close the door?