Many see democracy (or a republic, or any other kind of representative democratic system, which will hereafter be referred to as democracy) as a way for the populace to peacefully fight against oppression, totalitarianism, and corruption in their government, to keep the government functional and their lives prosperous. But it doesn't always work. Newly established democracies often fail catastrophically, sometimes by being overthrown by rebels (Sierra Leone), sometimes by coup (Peru, 1992), or by overwhelmingly supporting someone's power grab (Hitler's rise to Fuhrer in Germany).
All of these revolutions have been popular. The people weren't defeated, they did it to themselves. They removed their own democracies, and in the end were poorer for it.
The biggest danger to a democractic government isn't the bad man coming in from outside and taking it over, since an unpopular revolution will almost always fail. The biggest danger is the people themselves. The people have a responsibility to keep their government functional, and it requires a certain level of competence.
Minimum Requirements of the People
An Educated and Functional Middle Class
You need to be educated before you can be empowered. You need support for your basic needs, such as a job, before you can be educated.
The rich are educated enough, but cannot be counted on to not corrupt their government with bribery or vote in their own self interest at the expense of the majority. (The rich, more or less by definition, are not the majority)
The poor are uneducated and uninformed and can very easily be manipulated. Propaganda can be used to gain their support using almost any issue.
So the rich can't be trusted and poor are incapable, leaving the middle class.
The country in question, first off, has to have a functioning middle class, meaning the majority of the population is able to support itself with jobs. Some countries don't have one, the gap between the rich and the poor is extremely severe, usually due to a very weak economy, and in those countries democracy doesn't work.
A healthy economy is necessary for a middle class to exist, but doesn't insure that one does. Countries like Saudi Arabia have good economies but almost no middle class to speak of.
The voting populace also needs the ability to scrutinize the candidates, for which they need education. They need to know a certain level of history, current events, economics, and an understanding of the power structure in their government. They need the ability to recognize propaganda when they see it. The more knowledge a populace has, the harder it is to manipulate.
An Understanding and a Respect for the Values of Democracy
You can't force democracy on people, since the people are, in theory, in control. If the majority of people do not want democracy or do not understand why democracy is good, it will not happen.
Some cultures are incompatible with democracy. Very religious people sometimes want a theocracy instead, and if these people make up the majoriy of the population, their new democracy will quickly be replaced.
Other times people are subjected to a lifetime of anti-democratic propaganda. Often they believe it and can't be convinced otherwise. These people are also unhealthy for a democracy, and are likely to replace it with something else.
Minimum Requirements of the Government
Absolute power corrupts absolutely. The government needs a system in place to ensure that nobody can have absolute power, such as the branches of the US government. Under constant scrutiny and limitations, officials stay honest and functional.
Any government without multiple bodies checking each other constantly is doomed to end in a power grab, after which it ceases to function as a democracy.
Freedom of speech, and a free press, is essential for the populace to stay informed and make informed decisions. Uninformed voters are unable to do their function, and without that function, a democratic government will always fail.
The press must also be independent from, and not take orders from the government. The media must be able to excercise their freedom to function.
The courts cannot be controled by the people who make the laws, or they can make any law they want.
The outcome of trials cannot be controled by the people who prosecute criminals, or anybody can be made a criminal.
An independent court system is imperative both to stop it from being used to oppress the people, and to make sure officials can't overstep the boundaries of their position.
Free and fair elections are necessary for a democratic government to work on even the most basic level. Without them, the government in question can't even rightfully be called democratic.
There is nothing inherently safe about democracy, just look at the French Revolution. It doesn't automatically solve problems. If successful, it can be extremely beneficial, but it isn't guaranteed.
When establishing a new democratic government, meeting the minimum requirements for the government is the easy part. There are enough functional democracies around today to base it on, so there isn't any guesswork left in that. The hard part is the people.
American democracy didn't appear overnight either. It probably would have been disasterous if it had. First only white male land owners were able to vote. Then all white males, then blacks, then women and all other citizens.
Introducing a democratic government to people that are not ready for it is irresponsible, and very dangerous.