There are many ways to do so. Some people prefer to duplicate the layer, use the Pen Tool, the Quick Selection Tool or the Magnetic Lasso Tool to select the parts that they want to keep, invert the selection and delete the background. If you are using newer versions of Photoshop (2020 or later), there’s also the Remove Background option, located under Quick Actions in the Properties panel.