Select the layer you want to save as jpeg/png, then in the layers panel Photoshop will auto highlight whatever layer is selected. Then go to the eye icon beside the selected layer in Layers panel; hold down your alt key and click on the eye. This will make only the layer you want to save as jpeg/png visible while hiding other layers. Now trim the extra background by going to Image>Trim. Save your current image by pressing Alt+Ctrl+Shift+S. It will save your image for web ie. in either png/jpeg format.
The reason for doing the work is to create something useful that helps people. Please click the ads if my articles are useful for you. Definitely, that's not enough. My target is working at some great organizations, such that one day, all the people with internet access can benefit from the service I contributed.