What you'll need
Open a photo in Photoshop that needs straightening or cropping.
You’ll use the Crop tool with its Content-Aware option to rotate and straighten this sample photo and automatically fill the area around the straightened image with matching content.
You’ll also change the photo’s composition to a square and expand it beyond its original boundaries, relying on Content-Aware technology in the Crop tool to automatically fill in the outside edges of the recomposed photo.
The Crop tool’s Content-Aware option improves your photo-editing experience and brings the Crop tool into the family of Photoshop features that use special Content-Aware technology.
Select the Crop tool in the Toolbar. A crop boundary appears around the photo.
In the Options bar at the top of the screen, check the Content-Aware checkbox to turn on the Crop tool’s Content-Aware option.
Move your cursor outside of a corner of the crop boundary. When the cursor changes to a double-pointed, curved arrow, drag to rotate and straighten the photo. Use the crop grid that appears as a guide to straightening an object in the photo, like the bottom of this iceberg. Then release your mouse.
To commit the crop, click the checkmark in the Options bar or press Enter or Return on your keyboard.
The Content-Aware option automatically fills the edges with content that matches the rest of the photo!
Compare: Without the Content-Aware option enabled, rotating the sample photo with the Crop tool would leave parts of the photo outside the crop boundary. 
Trying to fix that by manually expanding the crop boundary would create empty areas at the edges that would require further retouching. 
Content-Aware Crop solves that problem. It expands the rotated crop boundary and automatically fills in any leftover empty areas with content that matches the photo.
Another common use for the Crop tool is to crop a photo to a different aspect ratio–for example, from horizontal to square. The Crop tool's Content-Aware option is a great way to automatically fill in any resulting empty areas at the edges.
With the Crop tool still selected, go to the Aspect Ratio menu in the Options bar and choose 1 : 1 (Square). A square crop boundary appears on the photo. Click inside the crop boundary and drag to reposition the iceberg inside the crop boundary.
Now expand the square crop boundary to include more of the iceberg. Move your cursor over a corner anchor point of the crop boundary and drag outward past the top edge of the photo. There is now an empty area inside the expanded crop boundary.
With the Content-Aware option still enabled in the Options bar, just click the checkmark in the Options bar or press Enter or Return on your keyboard, and the empty area is automatically filled with content that matches the photo!
Contributor: Ben Willmore