Sometimes, you have really great ambient light, but you want to be able to control the light falling on your subject. By default, your camera will simply expose for the flash, and ignore the ambient. This can lead to a properly exposed person floating in a black hole. To avoid this, you need to flip your camera to M and engage your brain.

5" at f/13 and ISO200
The key thing to remember is that shutter speed controls your ambient exposure, and aperture controls your flash exposure. Adjusting ISO affects everything, so it's best to leave that alone.
First, you have to think about how you're going to light your subject. Most people will probably use a speedlight. If your speedlight has TTL, this reduces the amount of thinking you need to do.
Most cameras default to a shutter speed of 1/60s for flash exposures. In a lot of cases, this is too fast for a good, low ISO ambient exposure.
Set your ISO to 100 or 200.
Then pick your aperture, since aperture is one of the ways to control your flash exposure. I like anywhere from f/8 to f/16.
After you set your aperture, balance your in-camera light meter as if you aren't using a flash. This means adjusting your shutter speed.
The flash will freeze your motion, but if you really really need a faster shutter speed, bump the ISO, and pick a smaller aperture or reduce the power on your flash.
If you're outdoors or using daylight for ambient, you're ready to shoot.
This process leads you to 2" at f/16 and ISO200, and a picture that looks something like this:
If your ambient is artificial light (tungsten/incandescent or fluorescent), then you need to gel your flash to match. Or you can gel your flash to mis-match for fun effects.
Tungsten gel against daylight ambient:
You can make your own gels from a sample kit, or buy them (I have the Nikon SJ-1 set).
Sometimes, you're really in the dark, so you need to increase your ISO.
Trial-and-error comes into play here:
3" at f/8 and ISO800, flash at -3.0EV
One last thing to consider is when you want your flash to fire. The default is usually a first curtain sync, which means the flash fires at the beginning of the exposure. I prefer second curtain (or rear) sync, because motion during the exposure looks more natural.