The first important gate was the way that the congress members were elected. Before they started being elected through popular vote, framers made it so that state legislatures choose congress members because they believed that people couldn't be trusted with such a serious issue like choosing their government members.
The second was the introduction of the electoral college. They didn't think that people would be suited for choosing the president directly so they made the electoral college based on the population size to choose the president instead of the people themselves. This process got reformed over time as well to increase democracy.