A 25-year-old man is brought to A&E after a fall from a ladder. His right leg has an open fracture of the tibia with bone visible and heavy contamination with soil. Distal pulses are present. What is the most appropriate immediate management in the emergency department?