Through both coercion and a newfound sense of pride and community within Germany. By playing on post WW1 fears of economic downturn, weak government and a weak Germany internationally, Hitler promised to restore Germany to its rightful place as a respected world power.
This was achieved by creating jobs with large nationalised infrastructure and manufacturing projects and a sense of national community - the “volksgemeinschaft”. This identity meant that Germans worked not for themselves, but for the greatness of Germany, meaning everyone had an identity as a creator of German pride - filling the identity void that had been increasingly present since WW1. Furthermore, opposition leaders, groups and dissenting voices were persecuted, placed in political concentration camps or assaulted. This combined with a constant presence of force - the SA (brownshirts) coerced those who may have disagreed to keep their thoughts behind closed doors whilst Hitler increased his influence over the German population through a combination of rousing speeches and daring international political moves (such as rearmament).