The Nazi attitude towards blacks is contradictory at best. In North Africa where Germans regularly came across them, the Nazis didn’t seem to treat them any differently from any of the other races in the area for the most part. There are even records of blacks serving in the Wehrmacht.
The sterilization of the blacks in the Rhineland stemmed from the fact they were the product of relationships between French black colonial soldiers and Germans rather than simply because they were black. They were a source of shame and disgrace among the Nazis.
During the invasion of France in 1940 French colonial troops (who were mostly black) were subjected to wildly different treatment depending on the attitude of the soldiers and officers they were captured and processed by. The Nazis never issued instructions on how blacks were to be treated if captured so it was mostly left up to local commanders to decide how they were treated. This meant they were either treated the same as other prisoners of war, subjected to worse treatment than other prisoners of war or simply massacred.
However, the Nazis always viewed blacks as an inferior race and they were subject to the Nuremberg Laws (like the Jews). Unlike the Jews, Romani, and Slavs they were never subject to an extermination campaign. Whether or not the Nazis would’ve exterminated them if Hitler had won the war is a matter of considerable debate. From what I’ve read about the Nazis over the decades I suspect the Nazis would’ve left it up to individual Nazi officials to decide what to do with them which means their treatment if Hitler had won would’ve been wildly divergent.