"Filter" - Distort - Lens Correction. (Translator's note: Because I was not sure whether everyone was using the English version or the Chinese version, after ignoring the Big Five version, I decided to add English text where necessary. The lens correction filter is not commonly used, haha.) ( Filter > Distort > Lens Correction) In the Lens Correction window you will see a grid pressed image and a few options on the right. We'll use the options on the right to straighten the photo.
You can easily adjust the perspective with this filter, just adjust the Horizontal Perspective and Vertical Perspective values. Perhaps you need to fix distorted edges using the options below.
This time, we'll change the vertical perspective from 0-50. The value is customizable, depending on the image you are editing. Set Edge to transparent, which means pixels will not be automatically added to the edges of the image. I referenced the grid and adjusted the distortion by feel.
Now use the crop tool to roughly select the area where the image still exists. We have to use the Clone Stamp tool to fix the transparent areas.