Use the Ruler tool (to get to it,click on the little triangle at the lower right corner of the Eyedropper tool in the Tools palette). Then click on one point on the horizon or line you want to straighten and, while keeping the left mouses button pressed, drag the mouse to another point on the horizon or line. Then let go. A reference line will be drawn for you.
Now, you can go into Image > Rotate Canvas > Arbitrary... (notice that the angle is already filled in for you) and click OK. That'll automatically align the reference line horizontally or vertically depending on which one the line is closest to. You can also just type in your own angle without using the Ruler Tool if you want.