"Walking the beam" is a staple of any laser-using experimental lab. Simply put,
These are the steps, which will be explained below. We'll assume each mirror has two knobs (i.e., two angles can be adjusted). If this isn't the case then well, you can guess what kind of time you'll have (or you will need four mirrors with two different kinds of mounts).
1. Mark the line in space you want the laser beam to occupy (the optical axis) at two points using irises (adjustable circular apertures).
2. Place one mirror (M2) very close to the first iris (I1), and another some distance away, closer to the laser.
3. Reflect the laser off of the two mirrors into the vicinity of the irises. This is a rough alignment, probably by just shuffling the position of the laser and mount around by hand.
4. Adjust the mirror closest to the laser (M1) to get the position of the beam right in the center of the first iris (I1).
5. Adjust the mirror closest to the first iris (M2) to center the beam on the second iris (I2).
6. Repeat steps 4-5 until the beam passes through both irises.
Why does this work? The beam itself travels in a straight line and can be described fully by 4 positional variables in a coordinate system defined by your line. One set of possible coordinates are, at a given point of the line, its x and y coordinates and the angles between the line and the z axis and each of the x and y axis. Alternatively, a line is just defined by two (x,y,z) coordinates.
If you could place the first iris right at the second mirror, it would be impossible to adjust the position of the beam on this iris using this mirror. By placing the first iris near the second mirror, you are making the second mirror the "angle controller" of the beam at the first iris (and the position of the beam on the second iris). The closer I1 and M2 are to each other, the more this is true. M1, on the other hand, will control the position of the beam on the first iris. Then, "walking the beam" is essentially the iterative optimization of the angles and x,y coordinates of the beam at the location of I1. The process converges faster if the inter-mirror and inter-iris separations are large and if distance between I1 and M2 is very small.
There are some other tips to keep in mind when doing this.
First, any optical axis you choose should probably be parallel to the optical table you are mounting all your equipment on. There are at least two reasons for this:
1) if your line has a large angle relative to the table, the beam is probably aimed at eye-height somewhere away from where you are working (which is hopefully well-below that height!)
2) most optical mounts which are fixed to the table are designed to operate with an optical axis (i.e., your beam line through space) that is parallel to the table. This makes alignment of refractive and diffractive components much easier, since you can work in a more-or-less 2D world if you mount them properly. If you are aligning a diffraction grating or, worse still, a sequence of them with some lenses thrown in (such a sequence is found in a grating dispersive stretcher) and your beam path is not confined to some plane parallel to the table, you can guess what kind of time you're gonna have.
Second, you want your irises to be very precise and rigid. In the typical case, one would walk the beam and then use the subsequent, well-defined beam in a much more complicated optical sequence. One can use the irises as a tool to re-align or to put a different beam through the sequence, since they define the optical axis of the whole assembly. If they are aligned in a bit of haphazard way, somewhere down the line you'll eventually notice that the optical axis you wanted is not the optical axis you've got. This is probably the result of having I1 and I2 too close together and having them at different heights. Deciding on which height to use is generally one that requires having planned out the entire assembly. As for rigidity, if something in your assembly is bumped, rigid irises will allow you to re-adjust the bumped component back into alignment. If you only have two irises and one of them is bumped out of alignment, you can re-align it to the beam as long as the beam is still aligned. If the two go out of alignment at once, well...
Third, try to keep the angle of the mirrors from getting too large and keep the beam in more or less the center of them. Even though increasing the inter-mirror distance makes the convergence faster, it is sometimes better to not get too ridiculous with this, since at vast inter-mirror distances even the slightest adjustment of M1 will deflect the beam off of M2. If the angle of the mirrors is very large, it is almost impossible to avoid clipping part of the beam.
In a complicated assembly, you will want to define the optical axis in at least a couple places. The reason for this is that, if 3000 knobs control the position of your focus at the end of a long chain of optics, any one knob can and will make that position wrong. If you have an optical axis which is defined at multiple points throughout the sequence, you can check approximately which knob you need to correct based on where you see your optical axis and the beam diverging (i.e., where the first iris that the beam is misaligned on is).