The vast majority of new representative democracies lapse into dictatorship early on.
- The English Civil War in England the converted England from a monarchy to a Republic in the late 1600s, collapsed after a few years and was followed by the restoration of an absolute monarchy from which a representative democracy emerged gradually over the next two hundred years with the franchise gradually growing and the relative power of the Prime Minister and the Monarch shifting over time.
- The French Revolution and the First Republic in the 18th century gave way to the Second Empire.
- The liberal democratic regime created after the Russian Revolution in the early 20th century - it lasted a matter of days.
- German's Weimar Republic in the 1930s - fail.
- Portugal and Greece have both had post-WWII coups.
- The lion's share of the new post-colonial democracies of Latin America, Africa and Asia experienced military coups or civil wars, followed by extended period of authoritarian rule and/or single party rule which often amounts to the same thing.
Some other answers have emphasized institutional or legal tools, like provisions in constitutions limiting amendments, but history tells a different story. The Weimar Republic had a state of the art constitution. England, which ultimately produced one of the healthiest representative democracies on the planet, still doesn't have a comprehensive, higher law status written constitution. Canada managed without one until the 1980s.
Far more important to the health of a representative democracy is the political culture of those who participate in government and the political system, and the competence of the people who conduct the affairs of that representative government. Part of this is the accumulated social capital of voting citizens ("the People"), but what really matters is the skill set and the values of would be political elites.
For example, one of the important features of the U.K. political system is that political parties carefully recruit, vet and affirmatively choose their nominees for political office, a power that U.S. political parties largely lost in progressive era reforms, and then, once a U.K. politician makes it to elected office, he or she still has almost no power as a back bencher for the party until his or her peers within the legislative wing of a political party elevate that member to a junior cabinet post or committee seat, a decision made by like minded partisans who know the individual well on a day to day basis and value that individual's ability to function well in a legislative arena.
Since almost all legislative policy making power in the U.K. is concentrated in a cabinet and leadership group of a few dozen out well over 300 elected officials in the majority coalition, it is easy to limit power to people whom well informed peers know are ready for the responsibility and are competent administratively.
In countries where representative democracy is abandoned by coup or revolution, the removal of the old government is often welcome (e.g. recently in Zimbabwe) where incompetence and corruption and a lack of a proper temperament tend to be the rule as early elected officials with no experience whatsoever running a representative democracy give it their amateur best try.
Faced with elected officials doing what is clearly wrong out of incompetence and/or mendacity, often of types voters didn't anticipate (at least in severity), and the lack of any politicians with the moxie to win the same post and oust the incumbent, it isn't hard to see how the situation gets so bad that drastic measurement must be taken, and the civilian establishment often has a too thin basis of competent elected officials, judges, lawyers and civil servants to pull that off. A lack of experienced and competent individuals qualified to run a Western style representative western Democratic system of government is often just too much.
For example, the really dominant factor in the slide of Sudan into authoritarianism after a brief flirtation with representative democracy was a shortage of officials with the knowledge and skills necessary to perform the duties and the elected officials, judges and the senior civil servants such a system required. They had perhaps 100 people qualified for those posts at the time if conducted in a Western-style fashion, but needed thousands of people with those qualifications for the system that they designed for themselves in their constitution to actually work reasonably well.
Similar factors are common elsewhere as well, not just in national governments, but at the local level and in NGOs that are intended to be democratically managed. For example, I am aware of a fairly new private college in East Africa where one of the main governance challenges has been finding someone with both the competence and the freedom from corruption to manage its finances without diverting funds or misreporting its accounts, something that has only been possible with outsider founders of the institution so far. They've found maybe a dozen people who have the skills necessary to do the job, but corruption is so pervasive in that region that almost everyone who manages to get the skills necessary to do the job also absorbs a culture of embezzlement, nepotism, and accounting fraud in the course of acquiring those skills (especially the men, one or two women looked promising but ended up being diverted by family or better prospects elsewhere).
The process of developing a non-corrupt corps of people with the right skills takes decades, and can't simply be brought into existence with the stroke of a pen. Imagine you have to make that same job search for hundreds of city managers, hundreds of managers of divisions and bureaus within government departments, and a thousand judicial posts. You see the problem.