A transverse wave is defined as a type of progressive wave wherein the particles of a medium oscillate in a direction perpendicular to the direction of wave propagation. An example is a water wave - the reason we see peaks and troughs is due to the particles rising and falling perpendicular to the direction in which the wave is moving.
Electromagnetic waves are also transverse, but in a slightly different context - in their case, there aren’t any medium particles oscillating at all because they don’t need a medium to propagate! Instead, it is the electric and magnetic fields that are oscillating perpendicular to the direction of wave propagation.
On the other hand, a longitudinal wave is the other type of progressive wave wherein particles of a medium oscillate in a direction parallel to the direction of wave propagation. A simple example is a wave made on a Slinky Spring, where we can see regions of compressions and rarefactions in the form of coils contracting and expanding respectively. Another example are sound waves.