Your dog should know how to sit on command.
It’s helpful if your dog knows “Touch”.
Train this at all outer doors, and at any interior doors where you would like for your dog to wait before entering.
Hand your dog treats where they are. Ideally, you won’t be asking for a sit each time you treat, so you want to try to treat in position so your dog doesn’t get up.
Your dog should remain sitting while you open the door where you are working.