The switch is screwed to the transmission. There is a little bracket that fits between the transmission shift lever and a slot in the switch.. It is held to the shift lever with a screw. There is a hole in the switch and in the bracket -- in neutral, the two holes should line up. Loosen the screw if they don't (best to use very small slip-jaw pliers -- the screw is usually too difficult to access to use a right-angle screwdriver), align the holes (you can use a drill bit or stiff wire, or just eyball), and tighten the screw.
Usually, however, adjustment isn't the problem. Either or both of the plastic bushings has gone, so that the transmission lever isn't in the correct place, or the switch is bad -- I'm on the second one on the 220D in six years (mostly becuase I have to crank it a lot to start it!).
Fairly simply, but I don't think it can be done without jacking up the car.
1972 220D ?? miles
1988 300E 200,012
1987 300D Turbo killed 9/25/07, 275,000 miles
1985 Volvo 740 GLE Turobodiesel 218,000
1972 280 SE 4.5 165, 000 - It runs!