For me, it depends on some factors. Am I trying to just keep the dust down or do I have to totally eliminate it, also demo dust and sanding dust can be pretty different in how invasive they can be.
If I'm just trying to keep the dust down, such as a remodel where there is already some dust from other projects and the homeowners know that dust is part of the project, then closing the door might be all that you do, and add a box fan to the window to direct the dust out.
If I need to eliminate the dust from moving into the rest of the house, then I would close the door and tape a plastic sheet on the out side of the door sealing the room with blue painter's tape, add a fan to the window. If there is no door then seal the doorway with a plastic sheet, if there is no door way, then I would look to a product by Fastcap call The 3rd Hand and build a dust wall with those.
There are also powered dust collectors that you can set in a room if you really are a pro.
For me, keeping dust from moving to other parts of the house is just part of the job. When I'm doing stain grade, high-end wood work such as boxed ceilings or custom hardwood panelling or built-ins, getting the dust out of the room I am working in is the main concern so the finish comes out as expected. Vacuum, vacuum and vacuum somemore, after each coat and sanding.