You say "pump" so I'm going to assume you've got a well with a submersible pump (or one of the old above ground pumps, but they're rare these days), rather than city water. If you have city water, find the main shutoff valve (usually near the water meter in the basement, I think).
Find the circuit breaker on your power panel that controls the pump and turn it off before working on the water. Ideally, there will be markings on each of the breakers describing (cryptically) what they control. After you're finished, have a helper turn it on and stay by the switch while you inspect for leaks.
If, for some reason, you really don't want to turn it off while you're working on it, at least locate it so you can run and turn it off before it causes expensive flood damage.
If you have city water, find the main shutoff valve (usually near the water meter in the basement, I think), and turn it off and on as with the circuit breaker.