In a laser an optical cavity is created by two mirrors at both ends of the laser.
Laser mirrors
These mirrors serve two goals:
The axis connecting the centers of these mirrors and perpendicular to them is called Optical Axis of the laser. The laser beam is ejected out of the laser in the direction of the optical axis.
An electromagnetic wave which move inside the laser cavity from right to left, is reflected by the left mirror, and move to the right until it is reflected from the right mirror, and so on.
Thus, two waves of the same frequency and amplitude are moving in opposite directions, which is the condition for creating a standing wave.
Remember that the electromagnetic waves inside the laser cavity are 3 dimensional, and are moving along the optical axis of the laser.