Typical f-stop scale:
1.8   2.8   4   5.6   8   11   16   22

Lens performance varies according to aperture. Most lenses are sharpest 2 stops above the widest aperture, through to two stops below the smallest aperture. As the lens is stopped down towards the smallest aperture you start to lose sharpness due to diffraction.

So for a camera with an f-stop scale as above,
the sharpest image would come from f4, 5.6 and 8, but the actual sweet spot is different from lens to lens. Some lenses might be sharpest at f4, some f5.6, but as a rough guide you can assume that the optical sharpness in the middle f-stop will be twice as sharp as the f-stops at either end of the scale. The only real way to see is to experiment with
your camera.

When comparing apertures you have to take into consideration depth of field. Depth of field is deeper at smaller apertures so, for example, at f16 most of a scene will be in focus with good performance in the corners. However, diffraction becomes a problem at smaller apertures, so although the image appears to be in focus throughout the frame, it’s sharpest point is not as sharp as the sharpest point of a photo of the same scene taken with a larger aperture. The photo taken at the larger aperture however, will not be in focus throughout the frame and will get increasingly soft in the corners as the depth of field gets shallower. So larger apertures will be very sharp in the centre but with noticeable vignetting, and smaller apertures will be sharp throughout the frame but not the sharpest possible due to diffraction. Note that maximum sharpness and maximum depth of field are therefore mutually exclusive.

Graph explained:
This is a sample result for a typical 1:1.8 45mm prime lens. The Y axis is sharpness, good at the top and poor at origin. The X axis represents the centre of the image at origin and progresses to the image corners.

The graph lines show the lens wide open is sharp in the centre but deteriorates dramatically towards the corners. Stopping down improves sharpness across the frame even at f2.8.
The very best results are seen at f4 and both f5.6 and f8 are close rivals. Although the images start to level off throughout the frame at f11, this is the point where diffraction starts to have an impact and sharpness is worst at f16.