Using Save for Web
When your image is ready to be put onto your web page, select "Save for Web"… from the File menu. The "Save for Web" dialog appears:
This dialog box allows you to tell Photoshop how you'd like to optimize your graphic for the internet. You have the ability to select the file format to produce (GIF, JPEG or PNG), what size palette you'd like to use, how to cut down the colors to fit the chosen palette size, how much to dither the optimized image (if at all) and how much image quality to sacrifice in order to produce a smaller file size.
You will see four tabs above the image view pane on the left side of the screen. These options allow you to view the original image, the optimized version (this is the default), the original and optimized versions side-by-side ("2-Up") and the original, optimized and two variations on the optimization all together ("4-Up").
You can use the Zoom tool to zoom in and out of the image; the Hand tool to move the view around; and the Eyedropper tool to select a color from the image which can be used by various color options on the right of the dialog.
There are many options in the Save for Web dialog, and the choices here can be quite bewildering! Fortunately, there are lists of presets you can choose from to make it easier. Select the Settings: drop-down list, which is located just below the Cancel button, to bring up the list of presets