|Yikes. (Intentionally tilted in software for purposes of illustration.)|
Most image editing programs will have at least a rotate function. You can use this to eyeball a correction. Or--my favourite--if your editing software allows, you can simply find a line in the photo that should be horizontal or vertical and, using the appropriate tool, drag your mouse along this line. The software will then do the rotating for you. Here's how to do it in my favourite software, darktable:
Open your image. In the right hand panel, click over to the basic group (the circle button), and then find the crop and rotate function. Select this function. Place your cursor at one end of a line that should be either horizontal or vertical. Right-click and hold, then (while still holding the right-click button) drag your cursor along the line to the other end. Release the button. darktable should automatically rotate the image for you.
If you're having trouble getting it just right, you can try zooming in to 100% or 200%. I find this often affords a more accurate correction. In this example, I'm using the shore as a guide, zoomed in to 100%:
|Straightening a horizon in darktable. Click to enlarge.|
Don't let your photos suffer from crooked horizons or diagonal verticals! Your viewers will thank you.
|Behold! A (more or less) straight horizon!|
18mm (~28mm equiv); 1/250 @ f/5.0, ISO 100