For simple keystoning correction, Lightroom works well and its tools are very easy to use. In addition to comprehensive sets of slider-based and automatic corrections, I often use its guided adjustment tool for architectural photos. The Julieanne Kost video Andrew cited provides a clear and concise tutorial.
Photoshop has essentially the same capabilities, plus a
Perspective Warp tool that can help (within limits) with very difficult geometry corrections, such as those introduced by stitching a panorama. However I find it rather finicky—which perhaps reflects my limited Photoshop skills.
But there's a limit to how much and how well post-processing can correct geometric distortion. I've never worked professionally as a photographer, but I suspect someone doing architectural work for a client would be better off investing in a tilt-and-shift lens and a panorama tripod head than trying to get the perspective right in post. Or by just standing back far enough when it's possible to work with a lens of the appropriate focal length, using a high-resolution sensor, and cropping so the image is usable straight-out-of-camera.
Almost all the
photos I've posted here had their geometry adjusted in Lightroom.