Fire codes are a set of regulations that govern the construction, design, and operational aspects of buildings to prevent fires and ensure the safety of occupants. These regulations enforce fire-resistive materials for construction, fire alarm systems, fire suppression systems such as sprinklers or extinguishers, and other measures to prevent fire.