Open the image in Photoshop
Duplicate the background layer
Select the subject using the Quick Selection Tool, Object Selection Tool, or Pen Tool
Refine the selection with Select and Mask
Adjust edge settings if needed
Output the selection as a layer mask
Hide or delete the background layer
Add a new background if desired
Save the file in the required format
