When the motor is properly aligned, the centerlines of the motor shaft, coupling, and load shaft "line up" horizontally and vertically
So you've set the replacement motor in place and leveled it. Your next step is to connect the load and align the motor. When the motor is properly aligned, the centerlines of the motor shaft, coupling, and load shaft "line up" horizontally and vertically. Traditionally, this procedure is performed using a dial indicator. The increasingly popular alternative is the laser alignment tool. Either way is fine, but make sure you understand how to use the measuring device before proceeding. It can't make up for operator error.
Before starting the alignment, visually inspect the coupling. Also inspect the mounting of the load and any related equipment. For example, an air compressor will have a large pipe coming off it, and any problems with the hangers can mean excess vibration back at the motor even if it's perfectly aligned.
To get proper alignment, you add or subtract shims from under the motor feet. First, align in the horizontal plane and then the vertical. Then, go back and check the horizontal. If you must change it, recheck the vertical. Once the alignment is complete, apply the specified torque in the required torquing pattern to lock down the motor. Observe the motor feet to ensure you aren't deforming them by overtightening.