The simplest approach is
neighbourhood averaging, where each pixel is
replaced by the average value of the pixels contained in some neighbourhood about
it.

The simplest case is probably to consider the group of pixels
centred on the given pixel, and to replace the central pixel value by the unweighted
average of these nine pixels. For example, the central pixel in
Fig. 18 is replaced by the value 13 (the nearest integer to the
average).

If any one of the pixels in the neighbourhood has a faulty value due to
noise, this fault will now be smeared over nine pixels as the image is smoothed.

This tends to blur the image.

A better approach is to use a median filter.

A neighbourhood around the
pixel under consideration is used, but this time the pixel value is replaced by the
median pixel value in the neighbourhood.

Thus, if we have a
neighbourhood, we write the 9 pixel values in sorted order, and replace the central
pixel by the fifth highest value. For example, again taking the data shown in
Fig. 18, the central pixel is replaced by the value 12.

This approach has two advantages.

Occasional spurious high or low values
are not averaged in -- they are ignored

The sharpness of edges is preserved. To
see the latter, consider the pixel data shown in Fig. 19.