To select all pixels on a layer within the canvas boundaries, do the following:
Select the layer in the Layers panel.
Choose Select > All.
Do one of the following:
Choose Select > Deselect.
Press Control + D (Win) / Command + D (Mac).
If you are using the Rectangle Marquee tool, the Elliptical Marquee tool, or the Lasso tool, click anywhere in the image outside the selected area.
The marquee tools let you select rectangles, ellipses, and 1‑pixel rows and columns.
Select a marquee tool:
Rectangular Marquee
Makes a rectangular selection (or a square, when used with the Shift key).
Elliptical Marquee
Makes an elliptical selection (or a circle, when used with the Shift key).
Single Row or Single Column Marquee
Defines the border as a 1-pixel-wide row or column
Specify one of the selection options in the options bar.
A. New B. Add To C. Subtract From D. Intersect With
Select Lasso tool and and enter a Feather value in the options bar to define the width of the feathering.
Notice the Anti-alias box is selected by default.
See Soften the edges of selections to know more about feathering and anti-aliasing.
To add to, subtract from, or intersect with an existing selection, select the correct option in the options bar.
Use the Polygonal Lasso tool to draw straight-edged segments of a selection border.
Select Polygonal Lasso tool and then the selection options from the options bar.
(Optional) Set feathering and anti-aliasing in the options bar. See Soften the edges of selections.
Select in the image to set the starting point.
Do one or more of the following:
To draw a straight segment, select and position the pointer where you want the first straight segment to end. Continue selecting to set endpoints for subsequent segments.
To draw a straight line at a multiple of 45°, hold down Shift as you move to select the next segment.
To draw a freehand segment, hold down Alt (Windows) or Option (Mac OS), and drag. When you finish, release Alt or Option and the mouse button.
To erase recently drawn straight segments, press the Delete key.
Close the selection border
Select and position the Polygonal Lasso tool pointer over the starting point (a closed circle appears next to the pointer).
If the pointer is not over the starting point, double-click the Polygonal Lasso tool pointer, or Ctrl-click (Windows) or Command-click (Mac OS).
(Optional) Select Select and Mask to further adjust the selection boundary.