First, put the camera on a tripod. Once locked in place it will be much easier for you to study the scene—whether through the viewfinder or via Live View on the LCD—and that will inherently lead to a more accurate composition.
Next, on my Canon EOS 5D Mark III I click the Info button on the back of the camera twice. This brings up the built-in level, which makes it easy not only to level the horizon, but also to ensure that my camera is aimed level at the scene and not tilted up or down. This kind of tilt doesn’t necessarily look skewed the way a crooked horizon does, but it can be very handy to start with a scene that’s perfectly level and adjust it in either dimension, as needed. Many cameras have virtual levels built in, so check your owner’s manual to see if that’s an option for you. If it’s not, you’re not out of luck. You can always use a hot shoe-mounted spirit level.
Much like the bubble levels used in carpentry, these levels use a bubble of air suspended in liquid. When the device is perfectly level, the bubble is balanced between two lines. It’s simple and effective, and a handy device for leveling the camera in a number of situations. And, since they mount directly onto your camera’s flash shoe, they’re easy to use and store, too.
If you’re entirely opposed to buying or carrying an additional piece of equipment such as the bubble level mentioned above, there’s one last-ditch option for you. Many tripods feature bubble levels built in to their heads. These come in handy for leveling the tripod itself, and with the head zeroed it will correlate, more or less, into a perfectly level camera as well. Although there’s a little more margin for error with this approach, it’s still a mostly reliable way to ensure the camera is level. And when the camera is level, straight lines will be straight—whether they’re horizon lines, walls, trees or ceilings.
If you still manage to take crooked pictures, you can always improve them in post. For instance, with Lightroom’s Crop tool (found near the top of the Develop module), you can click to crop an image and then position the cursor just outside any corner and click and drag to rotate the image.
Want to do it in Photoshop instead? There’s an even simpler tool here that’s exclusively for leveling horizons. It’s the Ruler tool, which will allow you to click and drag along any axis, either vertical or horizontal. It will draw a virtual line along the horizon, for instance, but then in step two, you’ll convert it to an actual edit. Open the arbitrary rotation dialog (Image > Image Rotation > Arbitrary), and you’ll see an angle value already plugged in.
Because you used the Ruler tool, it has determined you must want to level the line you’ve created, and that angle will make that happen. Simply click OK and watch as the canvas is rotated and your horizon is, in fact, level. You’ll also have some extra canvas around the edges, which you can get rid of with the Crop tool. Simply click and drag a rectangular marquee and then hit C to turn it to the Crop tool. This will define the area you want to crop and switch to crop mode. Then just click enter and, voilà, your image is level and cropped.