Look in the help or find a tuttorial for "guided upright". You can straighten curved edges or leaning buildings or distorted rooms. It's possible to make all sorts of corrections with that tool. It's available in both Lightroom and Lightroom Classic.
If you mean a slanted edge (buildings looking like a trapezium), then Upright is the tool to use. Curved edges would have to be corrected with a lens profile, or in Photoshop with warp tools, or the 'Adaptive Wide Angle' filter.