The Difference blend mode will change the colors depending on the color of the content on the layer(s) below the layer where it has been applied.
If what is below it is not black and white, then you can make the text black and white with some adjustment layers and layer masks. Here's how:
- Enter your white text on a layer above the other content.
- Control (Windows) or Command (macOS) + click on the thumbnail of the text in the Layers panel to load the selection of the text.
- Add a Hue/Saturation adjustment layer (click on the middle icon at the bottom of the Layers panel and select Hue/Saturation... or go to Layer > New Adjustment Layer > Hue/Saturation...). The selected text will be applied to the adjustment layer as a layer mask.
- With the Hue/Saturation adjustment layer selected, go to the Properties panel and move the Saturation slider all the way to the left (-100).
- Depending on the content below, the text might appear as various shades of gray instead of black and white. To add more contrast add a Levels adjustment layer click on the middle icon at the bottom of the Layers panel and select Levels... or go to Layer > New Adjustment Layer > Levels...).
- Move the triangles below the histogram to increase the contrast (move the dark one on the left to the right and the lightest one on the right to the left).