The Magic Wand is one of several techniques available within Photoshop for the selection of part(s) of an image. It can be selected from the Tools Panel (second from top on right) or by hitting [W] on the keyboard.
When Magic Wand is selected, the Options Panel appears under the Main Menu:

The four icons in the group are, left to right, New Selection, Add to Selection [Shift], Subtract from Selection [Alt] and Intersect with Selection [Shift][Alt].
Tolerance (0-255) sets the range of pixel colour brightness that will be included from the initial click point. So with Tolerance set to 8, if you click a pixel with an RGB value of 50,60,70 then all pixels with values from R42 to 58, G52 to 68 and B62 to 78 will be selected. If Contiguous is checked, then the pixels must have a direct line of contact to the click point.
When Anti Alias is checked, the selection will have a 1 pixel transition into the surrounding colours which helps avoid jagged edges. It’s best to leave this checked.
Use All Layers does just what it says.
Generally, you should aim to use as low a Tolerance as possible and to Add to Selection by use of the [Shift] key. If the Tolerance is set high enough to select all the pixels you require with just one click, then it’s likely that you will be bleeding into adjacent pixels.
It is worth looking at the Channels Palette and clicking the Red Green and Blue channels (click the words, not the eye) in turn to see if one of them offers better contrast. If you use one and save the selection, you can reload it on to the original image.
When you have spent a few minutes on the selection you should save it. The command is on the Select Menu. Give it a name with a number eg sky1. Further work should be saved as sky2 and then you can overwrite sky1 for the next step. This way you always have something reasonable to go back to should you make an error.
To re-load a saved selection, turn to the Channels Palette and [Ctrl] Click its name.
If you have already deleted the area (on the mask) and you load a selection and modify it, don’t forget to delete again ([Alt] Backspace with Black foreground)
Difficult Selections. If, for example, you are trying to select a sky area behind trees, then it’s necessary to have Contiguous unchecked. A problem may well occur wherein many other parts of the image become selected because they are of a similar colour brightness.
One possible way of overcoming this is to use a Lasso tool to draw a selection around the sky/tree area and to copy this to a temporary layer using [Ctrl] J
If you now [Alt]-click the Eye on the new layer, any other layers will be turned off. Make sure that Use All Layers is unchecked and then use the Magic Wand to create the selection on this layer, and then save the selection. This selection can then be loaded onto the full image and the temporary layer discarded.