While there are a number of ways to straighten a photo, this technique is a lot of fun because you can see the exact amount Photoshop will rotate the image. Grab the Ruler tool (hiding under the Eyedropper [I] in the Toolbar), and click-and-drag along the horizon. Choose Image>Image Rotation>Arbitrary. The Rotate Canvas dialog will appear with the Angle already set based on the line you just drew with the Ruler tool. You can also use the Ruler tool to measure angles and sizes of things on the canvas. Just look up at the Options Bar, and you’ll see the size and angle change as you draw your line.
This tip previously published in Colin Smith’s Photoshop Tips column, in the March, 2019 issue of Photoshop User magazine.