As is usually the case, creating an optimal image in-camera will have the best results. When fixing horizon tilt in Photoshop, you must crop in on the image which can effect composition and image size.  When composing the photograph, always take an extra moment to look at the horizon and try to make sure it’s as straight as possible.

Begin by opening your image file in Adobe Photoshop. I find that performing all required cropping before image adjustments is a logical workflow, as you’re cropping out any elements from the image before any adjustments are made. Select the measure tool by long pressing on the eye dropper tool and selecting the ruler icon, or tap “i” while holding “shift” until the ruler is selected.

With the measure tool selected, click and drag from right to left while matching the angle of the horizon as close as possible. When done successfully, there will be a thin line overlayed on the horizon, with small crosshairs on either end. The closer you match the angle of the horizon, the more accurate your rotation will be. At this point, be sure to select a bright red, or noticeable color, for the background color picker. This will help later once you’ve rotated your image.

Next, go to Image > Rotate Canvas > Arbitrary. If you’ve correctly traced the horizon with the measure tool, you’ll see a value automatically entered here. Hit OK and the canvas will be rotated to level the horizon. If the results aren’t perfect, go back a couple history states and try tracing the horizon with the measure tool again, and repeat the arbitrary image rotation.

Once you have the canvas rotated and are happy with the horizon, select the crop tool and remove any portion of the edges of the photo that contain the red background color. Because you’re forced to remove a portion of the photo by cropping, that’s why it’s important to properly compose the photograph when taking the picture. The image rotation should be as minor as possible to fine tune the horizon angle.