This example was exactly the issue Socrates had with democracy actually, saying that a demagogue would be elected as a president or leaders of government the majority of the time. His solution was just as vague, so let's just say there is no perfect system yet. All have their benefits and drawbacks.
Look it is messy, my feeling is you vote or don't vote for a party based on their policy and track record, but after elections they have the will of the people to act, so they should then focus on the technical issues of government by being guided by their election promises, policy and the country's constitution to ensure that minorities aren't discriminated against for example.
Agree, but there are many flavours of it. For example we began the discussion on how Mexico extended their democracy to now include the judicial branch of government, others can be how they vote, for example electoral college in USA, ranked choice voting in some European countries like France or my country, South Africa, we have proportional representation and cannot even vote for our president