Clear the selection or select the rest
Swap a selection for everything else with Edit › Invert Selection, or clear it with Edit › Select None.
MiniBeginner1 minMenu: Edit › Invert Selection
Use Invert Selection when it is easier to pick what you do not want, then flip the selection. Use Select None to clear the selection, so that nothing is picked for the next command.
Steps
Click the orange rectangle. It is selected, with its handles.
Choose Edit › Invert Selection. The Edit menu is open here, with Invert Selection marked 1 and Select None marked 2.

The yellow and teal rectangles are selected now, and the orange one is not. Invert Selection picks everything else on the layer.

Choose Edit › Select None. Nothing is selected.
Tips
- Select None is also on Esc.
- Press ⌘A for Select All if you want everything, not the rest.
- To go back to the selection you had before, use Edit › Previous Selection. See Bring back the previous selection.