First open a black and white photo in Photoshop:

Then create a new layer named "color"

Next, color the new picture. Here we use #b36301 and #ae925a to color the face, and #b2b0c to color the hair, as shown in the picture below:
Of course, more details need to be painted, such as painting the lips with red, painting the collar with blue, and painting the background with black, etc., which are omitted here.

Finally set the blending mode of this layer to "Soft Light":

At this time, we can also make more in-depth adjustments, select the menu Image-Adjustment-Dark/Highlight, and make the following settings (whatever you feel is appropriate):

We finally get the following effect:

For black or white, use "Overlay" and then adjust the opacity. Don’t just limit yourself to “soft light”, try more.