To answer this question, I will assume you are asking about how a democratic republic works? In a country like the United States, which has a democratic republic, we elect leaders to make the laws for us. The people vote for whom they want to represent them in government. These people are then expected to carry out the wishes of the majority of the people they represent. In theory, the power lies with the people since they have the ability to choose who will represent them.
If you are asking about a direct democracy, then all of the people who are citizens would be involved in the process of making the laws. This would be very difficult today if a country expected all of its citizens to be involved in the process. Ancient Athens is often used to describe a direct democracy, but even in ancient Athens, there were limits on who could participate. Only male citizens were allowed to participate in ancient Athens. Many who could participate in ancient Athens didn't participate because they had military or work commitments.
A democratic republic or representative democracy is an example of a democracy used in some countries today.