During WWII*
German soldiers, many times, actively participated in the Holocaust. Hitler regularly issued orders that all Jewish troops captured were to be executed (hence, why Rommel became famous for actively going against the order), and even in regards to Black African troops, Nazi/Wehrmacht soldiers, while not given active orders, often executed them anyway as part of the Final Solution, and Germans in the Eastern Front even executed certain Russian troops for having perceived "Jewish" traits, such as a large nose.
Originally, the conservative German leadership did not respect Hitler, and saw him as a political upstart and firebrand. They even fired upon him during his attempted coup. Things changed when Nazis began to change German military policy, such as ordering the oath of service be to the Furher, rather then the Constitution of Germany, and ordered all Jews be forcibly removed from the army.
While Senior Officers were more pragmatic and laid back, younger officers and Junior officers were often raised from their child years onwards to have heard Nazi propaganda often 24/7. "Education Officers" were also key in using propaganda and racist rhetoric when educating their troops, and Newspapers became tools of the propaganda ministry.
Second, soldiers received the “Guidelines for the Behavior of the Troops” which taught them that “this war demands ruthless and aggressive action against Bolshevik agitators, snipers, saboteurs, and Jews, and tireless elimination of any active or passive resistance.” Thus, Jews became almost immediately a target for the German army, and Soviet Commissars, despite going against the treaties, were also executed.
Furthermore, the attempt to assassinate Hitler by several Military leaders, was not an attempt to halt the Holocaust, as many were just as tied to it as Hitler. Many of them came from Upper Middle class and Upper Class families, and had no issue with seeing the Jews gotten ride of, so long as they could keep their positions. Two stand out as different.
Henning Von Tresckow actively hated the Nazi regime and after witnessing the execution of two captured soldiers by SS troops, decided Hitler and his goons must be put down.
"I would like to show the German people a film entitled 'Germany at the end of the war.' Then perhaps people would be alarmed and would realize where we are heading. People would agree with me that the superior warlord (Hitler) must disappear. But since we cannot show this movie, people will bring up the 'stab in the back' legend whenever we act against Hitler."
The stab in the back rumor began under Nazi leadership that Jewish officers had been the first to have their troops surrender and give up during WW1, which Tresckow frowned up. The other, was Erwin Rommel, who refused to execute captured Jews or blacks, and treated them well, hence why he became lionized by the British soldiers that fought him.
Men such as these were extreme minorities in the German army, however, and most were deeply connected to horrible war crimes.
In addition to u/Zillafire101's answer, you might be interested in u/ParkSungJun's comment in this previous thread: