This is a question that the selectorate theory tries to answer. Essentially:
As a dictator, you need to identify the people who are essential to you remaining in power. For example: the controllers of the army, the police, etc.
Then, you need to establish control of the revenue stream. This can take the form of taxes from the people, or natural resources that can be extracted to generate money.
Now, ensure the loyalty of the essential people by paying them using the revenue stream. Pay them enough so that they will remain loyal to you and follow your commands, but not so much that they cease to be dependent upon you.
You have now established a working dictatorship.
This is how dictatorships rise to power and stay there for many years. All that is needed is the support of a relatively small group of people, and the people can be kept under control by the army/police even if a majority disapproves of the current government.
If you don't think this is realistic, picture five people with machine guns in a room with one hundred people.
Why do the army/police follow their superiors' orders? Because the dictator's essential supporters don't just take the money they get from the dictator for themselves, they also redistribute it to their followers in order to ensure their loyalty, who do the same to their followers -- all the way down the chain of command.
There are some exceptions to this system. The first is protests. If the people are able to gather in a large enough group and organize, they are sometimes able to overwhelm the power of the state. Then, the state is either forced to make reforms, or it is completely overthrown and replaced with another. This does not happen often, however; usually, the government is able to repress the rebellions, unless the leader displeased his essential backers, and they support it. However, sometimes, such as when hundreds of thousands of people gather together in the aftermath of a natural disaster, the protests can succeed and the government is overthrown or forced to institute reforms.
Another thing that may cause a dictatorial government to fall or democratize is a failing economy. As less and less money trickles back to the government, the leader becomes unable to pay its essential backers as much as it used to. As a result, they may decline to suppress the population in the face of rebellion, and the government will be overthrown. Alternatively, the regime may decide to increase the citizens' productivity by providing public goods and increasing freedoms. For dictators, this path is risky, however, as this simply increases the ability of the people to protest for more reforms.
For more information, you can check out The Dictator's Handbook or watch CGP Grey's video on the subject Rules for Rulers for a simple explanation.