Check Your Histogram
Most digital cameras have a little chart called a histogram. The histogram shows you how many pixels you have at different brightness levels. The values on the left edge of the histogram are pixels that are black. The values on the right edge of the histogram are pixels that are white. Your goal is to get an exposure in which all of the pixels fall somewhere in the middle.
This is a good histogram because it doesn't touch either the right or left edge.
This histrogram shows that the picture is overexposed. You see part of the histogram piled up on the right edge. That means that some parts of the picture got too much light and are now just blank white.
This histogram shows that the picture is underexposed. You see part of the histogram piled up on the left edge. That means that some parts of the picture got too little light and are now just featureless black.
Sometimes the range from dark to light in your picture is too big and you can't get everything between the edges. In those cases, it is
usually better to keep from hitting the right edge. Dark shadows don't usually hurt a picture as much as bright, white patches.
You cannot avoid bright, white patches in some cases, like bright reflections or having the sun in the picture. In those cases, you have to decide whether you can recompose your picture to avoid the bright spots or whether you are better off just leaving them.