The event you're referring to is called "Vaka-i Hayriye" or the "Auspicious Incident" in English. It occurred in 1826 during the reign of Sultan Mahmud II. It involved the abolition of the Janissary Corps, a historic military institution in the Ottoman Empire. Sultan Mahmud II secretly ordered the burning of the Janissary barracks and arsenals as a means to dissolve the Janissary Corps, which had become outdated and undisciplined. This event marked the end of the Janissary Corps and paved the way for the modernization of the Ottoman military.