When Louis XVI became king, he was inexperienced and unprepared, he was easily manipulated and a weak leader. the French people had little faith in him. He and his wife Marie Antoinette believed in the divine right of Kings and thought the rest of France did as well. The believed that the third estate (peasants/ working class) were made to do all the hard work for them.
Traitor
In 1778 France went to war with England but lost and was left with severe financial debt. The King loaned more money to the Americans for their revolution and were now in even more debt; with the people questioning the necessity and leadership of their King. The king and his aids decided to tax the poor, who were already struggling, with the first and second estates paying little to no tax. This created an angry population with a deep dislike for the King.
Radicals
Realizing how unfair the system was, a new group formed called the "National Assembly" . The radicals within this group were the "Jacobin club" who wanted the removal of the King entirely. The King feared for his position and had just dismissed his finance minister trying to make reform. Violence had become normalized with events such as the "Storming of the Bastille". The people of Paris were bloodthirsty and wanted the King to know it.
Execution
The King lived in Versailles away from the people of Paris, so they were eager to remove that separation. Women marched to the Kings palace and demanded an audience with him. Ultimately, he went to Paris with the crowd where they made him do various things to prove his loyalty to the revolution. He tried to leave France to and flee to Austria in 1791 but was recognized and sent back. Now the people considered him a traitor. his powers were reduced to that of a figurehead.
The two sides of the revolutionaries were exposed: the moderates who wanted to keep the King as a figurehead and the radicals who wanted to see him deposed. Countries nearby feared that they would succumb to revolution as well and did not want this; a Duke from Prussia wrote a letter saying that if anything happened to the King he would burn Paris to the ground and this enraged the French people. The national assembly voted to suspend the monarchy entirely and Louis was sent to a prison cell.
The "French republic" was declared and enlightened ideas about democracy were being developed but these were overridden by the thirst for blood. The once -king was put on trial for treason and found guilty and executed by the guillotine in 1793. Ultimately i do not think he deserved to be executed as the ideals surrounding him had given him an unrealistic view of the world and he was unprepared to be King. He had self preservation instincts like any human but his leadership was terrible and decisions misguided.