With the camera's controls. That one, and that one, and the one over there, plus the one that's buried in the menus. (Oh oh, Thom's in one of those moods again.)
You've probably noted it elsewhere on this site: I don't write a lot about taking photographs, I write about capturing optimal data. That really needs a lot of explanation, and I'll see if I can do just that soon. For now, however, let's back up a minute and revisit the film era.
If you shot slide film, you realized that you had to get exposure "right" or else you got bad results. If you let too much light into the camera, some areas of the resulting slide became clear acetate. That doesn't project too well, as all you get is the light of the projector and the texture of the screen, neither of which are part of your photograph. If you let too little light into the camera, details in the shadows would disappear. If you were shooting Velvia, details in the shadows really disappeared. Setting correct exposure in the slide film world was basically trying to get as much into the limited capture range of the medium as possible.
If you shot print film, you probably weren't really controlling exposure (as many students found out when we photo instructors would move them from print to slide film). Print film had a wide latitude for exposure, maybe as much as five stops with some types of film. What you didn't know is that the automated print labs would simply do a "correction."
Digital is closer to slide film than print film. Basically, you have keep from letting too much light in or you get values that are maxed out at 255 (8-bit values) and lay no ink down on the paper. That's akin to slide film's clear acetate problem. On the other hand, while you can often boost the low end of the exposure (shadows) in post processing, doing so tends to dredge up noise and a bit of mush due to the lower number of bits being used to record values (especially true of 8-bit JPEGs and TIFFs).
There's no perfect answer to this, and people like Ansel Adams wrote multiple books on just this one question. In other words, I can't answer it in a FAQ. I'll see if I can expand on the answer with an article or two eventually.