I'm making a letter M in Illustrator by using the pen tool and drawing half of the letter and then mirroring it with a transform effect. I noticed that when I zoom in there is a hairline space due to the fact that the edge is not 100% vertical. I've tried moving the anchor point around but I can't get it completely vertical even when holding shift.
You can select two or more anchors and click the buttons on the Align Panel or the align buttons on the Control Panel across the top of the screen (if it's set to align to selection).
Or select the anchor points and choose
Object > Path > Average and select the "Vertical" option.
Holding shift constrains the angle to increments (usually 45 degrees). So if your line is at 90.005 degrees it will increment to 135.005, 180.005 degrees, etc.
The quickest way to make a line completely vertical though is to select it and make sure the width is 0 in the Transform Panel. I actually use the panel often to make sure I've drawn completely vertical or horizontal lines because of how easy it is to access.