Follow these instructions.
Compression settings can be adjusted during the "Save" command.
The quality goes from lossy 0 (the image is degraded to fit in fewer bytes) to lossless 100 (pixels stay exactly the same). Usually the compressed size increases with quality but for some images (e.g. screen captures, plain colors...), the lossless algorithm produces smaller files.
The compression effort controls the encoding speed. Slower increases the visual quality and/or decreases the file size.
The preview feature will show the compressed image and its final size. If the picture is too tall or too wide, a moveable zoomed-in area will appear. Warning: for big images and/or heavy compression effort, the graphical user interface may be slow/unresponsive when this is enabled.
For animations (several layers containing a duration in their name e.g. "Frame1 (123 ms)"), a slider will select the current frame, showing its preview and duration.
For photography, quality around 70 is a good start. If size is more important (e.g. icons, heavy-traffic web photos...), going as low as 30 is not uncommon.
For artificial images (e.g. black-and-white text, low-effect 3D renders...), quality of at least 98 might be better-looking and smaller.
If these options are not enough to get a satisfying result, the command line tools offer more settings than this Photoshop plug-in.