When replacing a window or door, sealing it properly is crucial to prevent water and air leaks. A good installation should follow the order of operations—framing, sheathing, membrane, sealant, flashing, insulation, and siding—thinking like a falling raindrop the whole way through.