This post will teach you about a feature that is connected to the crop tool in Photoshop. Open the photo and then click the crop tool or hit the shortcut key “c”. Once you activate the crop tool you will have the “Straighten” command in the tools panel above.
Click “Straighten” and then draw a line with the mouse across the horizon you want to be the corrected. The photo will rotate and crop out the corners. Then click the check mark or hit enter to commit changes