Photoshop’s Curves adjustment and masks can be combined for selectively editing highlights and shadows in an image
Apply multiple Curves adjustments to an image for boosting highlights and darkening shadows.
Invert their masks to black by pressing Cmd/Ctrl+I.
On these black masks, use the Brush tool set to white, a low opacity of 20-30%, and 0% Hardness, to selectively paint over these masks.
Notice how the highlights and shadows come through on the image wherever you paint, enabling you to control the lighting.