I have 2 layers in Photoshop, I want to substract one layer from the other so that every pixel that is the same in both layers gets deleted and every pixel that is different stays. I tried to do it with blending but I think its not the right tool for this quest.
With a simplified example, it's not hard, I think this will also cover a realtime problem:
The correct blending mode would be Difference.
This blending mode does not only mark you which pixels are different but at what extent.
It the difference is very subtle, you can not see it, you need to adjust the resulting image to see the pixels.
On this webpage, I used the blending mode to analyze the difference between a base image and the artifacts produced by different JPG settings of different programs. But as an extra step, I used Levels to increase the contrast and actually see the pixels.
Difference blending mode will render pure black if there is no difference and will give you lighter colors depending on how different the subjacent pixel is.
Now, for "deleting the pixels" you probably want to make a mask out of this resulting image, and applying it to any of your two original sources.