Crop an image and discard (not just erase) the unselected part

I am a beginner and have a totally naive question. When I crop an image the selected area is retained and the space outside the selected area is erased. My question is, how do I resize the file image so that it is equal to the area of the cropped image?