That's what constitutions and bills of rights are for. They set up inalienable rights that every individual has and the state defends those rights, those don't depend on the majority and the majority is not allowed to touch those(usually). And from there on majority rules... usually... kind of*... as long as they don't step on those basic human rights. If they do, the state needs to act to defend those rights and seek remedies to the situation.
*the asterisk is there because even though in theory majority rules, there might be influences that overtake the political process in a country(oligarchies or lobbyists pushing and succeeding to enact policies that go against the will of the majority but are in favor of certain influential minority).
The constitution can be amended by a large enough majority.
Also, people hide behind the "will of people" only when it advances their own agendas. Otherwise, in the words of Tocqueville, it is the tyranny of the majority.