The purpose for the Gestapo was to hunt those who were considered a threat to Nazi Germany. They often went door to door interrogating innocent citizens of Germany. At the start of WW2 they often hunted Jews, Communists, Jehovah's witnesses and other minority groups.
When war broke out the Nazis saw many other groups as threats,such as, socialists and trade union leaders. Eventually the Nazis became the only legal party