Using Adobe Illustrator CC's Pen tool requires a little more coordination than using other Illustrator tools. Fortunately, Adobe Illustrator includes features to help make using the Pen tool a little easier. To make a correction to a line you created with the Pen tool, follow these steps:
Choose Select→Deselect to make sure that no objects are selected.
Select the Direct Selection tool from the Tools panel.
Notice the helpful feature that enlarges the anchor point when you pass over it with the Direct Selection tool.
Click an anchor to select one point on the line.
Notice that the selected anchor point is solid and the other is hollow. Solid indicates that the anchor point you clicked is active, whereas hollow is inactive.
Click and drag the anchor point with the Direct Selection tool.
The selected anchor point moves, changing the direction of the path while not affecting the other anchor point.
Use the Direct Selection tool (press A to use the keyboard shortcut to select the Direct Selection tool) to make corrections to paths.
Make sure that only the anchor point you want to change is active. If the entire path is selected, all anchor points are solid. If only one anchor point is selected, all but that one point will be hollow.
Now look at how to create a real straight line — one that’s on multiples of a 45-degree angle. Illustrator makes it easy; just follow these steps:
Select the Pen tool and click the artboard anywhere to place an anchor point.
Hold down the Shift key and click another location to place the ending anchor point.
Notice that when you’re holding down the Shift key, the line snaps to a multiple of 45 degrees.
Release the mouse button before you release the Shift key or else the line pops out of alignment.