When a vibrating body moves forward, it creates a region of high pressure in its vicinity. This region of high pressure is known as compressions. When it moves backwards, it creates a region of low pressure in its vicinity. This region is known as a rarefaction. As the body continues to move forward and backwards, it produces a series of compressions and rarefactions. This is shown in the figure below(here C is for compression and R is for rarefaction)
Compression is defined for the longitudinal waves in which the particles come closer such that it is at high pressure.
Rarefaction is defined for the longitudinal waves in which the particles move apart such that it has a low pressure.
When the school bell is hit with a hammer, it moves forward and backwards producing compression and rarefaction due to vibrations. When it moves forward, it creates high pressure in its surrounding area. This high-pressure region is known as compression. When it moves backwards, it creates a low-pressure region in its surrounding. This region is called rarefaction.