A Laser requires a laser Resonator (or laser cavity), in which the laser Radiation can circulate and pass a Gain medium which compensates the optical losses. Exceptions are only exotic cases where a medium with very high gain is used, SO that amplified spontaneous emission extracts significant power in a single pass through the gain medium.
The laser radiation is automatically generated at one or several frequencies corresponding to resonances (resonator modes), possibly with small deviations caused by "gain pulling". No special measures are required to obtain resonance; this is different for external resonators, e.g. resonant enhancement cavities.