Find a spot on the level of the cavern-water with a significant amount of rock (ideally with a 'corner', but that's not necessary).
Let's say it looks like the following, with a stairwell through in the top-left corner, and water surrounding a mass of rock, 'exposed' wall as indicated:
▓▓▓░░░░░░▓≈≈≈≈
▓X▓░░░░░░▓≈≈≈≈
▓▓▓░░░░░▓▓≈≈≈≈
░░░░░░░░▓≈≈≈≈≈
░░░░░░░░▓≈≈≈≈≈
░░░░░░░░▓≈≈≈≈≈
░░░░░░░░▓≈≈≈≈≈
░░░░░░░░▓≈≈≈≈≈
░░░▓▓▓▓▓▓≈≈≈≈≈
▓▓▓▓≈≈≈≈≈≈≈≈≈≈
≈≈≈≈≈≈≈≈≈≈≈≈≈
On the Z-level above, I dig slightly out from the stairwell I'll want to access the water from (maybe to build wells, later), dig a channel to the water-level (creating an up-ramp here) and then generally diagonally towards some useful bit of wall. (Here shown in red.)
▓▓▓░░░░░░▓≈≈≈≈
▓X▓░░░░░░▓≈≈≈≈
▓▓▓▓▓░░░▓▓≈≈≈≈
░░▓▲▓▓░░▓≈≈≈≈≈
░░▓▓'▓▓░▓≈≈≈≈≈
░░░▓▓,▓▓▓≈≈≈≈≈
░░░░▓▓`.▓≈≈≈≈≈
░░░░░▓▓,▓≈≈≈≈≈
░░░▓▓▓▓▓▓≈≈≈≈≈
▓▓▓▓≈≈≈≈≈≈≈≈≈≈
≈≈≈≈≈≈≈≈≈≈≈≈≈≈
...note the additional orthagonal dig-out next to the end.
1) Smooth the rock at the corner-wall next to the water (I actually smooth pretty much everywhere, but this is the important bit).
2) Place a floodgate at tunnel-end
3) Link the floodgate to a lever, and then operate the lever to open it (but below shown as closed).
4) Build a pillar on the adjacent square to the floodgate
5) Remove rubble from the tunnel by dumping or just ensuring you can get it stockpiled or otherwise used (optional)
(You can do #s 2 and 3, regarding the floodgate, before #1, and indeed
must do. The pillar cannot even be designated to be built without causing floodgate-placement to fail (unless this has changed, recently), so has to happen after #2 and #3, but once the floodgate is placed/linked/opened it doesn't tend to interfere with any of the other steps. But the above is the general order I tend to work with. The removal of spoiler materials in #5 is actually arranged ASAP upon the appearance of dug-out-rocks, but tends to often be the very last thing that ends up complete.)
▓▓▓░░░░░░▓≈≈≈≈
▓X▓░░░░░░▓≈≈≈≈
▓▓▓▓▓░░░▓▓≈≈≈≈
░░▓▲▓▓░░▓≈≈≈≈≈
░░▓▓'▓▓░▓≈≈≈≈≈
░░░▓▓,▓▓▓≈≈≈≈≈
░░░░▓▓`O▓≈≈≈≈≈
░░░░░▓▓X▓≈≈≈≈≈
░░░▓▓▓▓▓╝≈≈≈≈≈
▓▓▓▓≈≈≈≈≈≈≈≈≈≈
≈≈≈≈≈≈≈≈≈≈≈≈≈≈
Now from the opened floodgate square (dwarf in green), you can set to carve Fortifications in that smoothed corner square.
▓▓▓░░░░░░▓≈≈≈≈
▓X▓░░░░░░▓≈≈≈≈
▓▓▓▓▓░░░▓▓≈≈≈≈
░░▓▲▓▓░░▓≈≈≈≈≈
░░▓▓'▓▓░▓≈≈≈≈≈
░░░▓▓,▓▓▓≈≈≈≈≈
░░░░▓▓`O▓≈≈≈≈≈
░░░░░▓▓☺▓≈≈≈≈≈
░░░▓▓▓▓▓╬≈≈≈≈≈
▓▓▓▓≈≈≈≈≈≈≈≈≈≈
≈≈≈≈≈≈≈≈≈≈≈≈≈≈
...while the dwarf is there, you can pull the lever again. The dwarf itself stops the floodgate from closing until he/she is finished anyway.
Depending on how prompt the lever-pulling is (it can be slow) you can end up with one of
two situations. On the left, the ideal situation, on the right the less ideal but still pretty safe (unless it was magma that you was being tapped, not water... Because I also use a variant of this system for tapping magma.)
▓▓▓░░░░░░▓≈≈≈≈ ▓▓▓░░░░░░▓≈≈≈≈
▓X▓░░░░░░▓≈≈≈≈ ▓X▓░░░░░░▓≈≈≈≈
▓▓▓▓▓░░░▓▓≈≈≈≈ ▓▓▓▓▓░░░▓▓≈≈≈≈
░░▓▲▓▓░░▓≈≈≈≈≈ ░░▓▲▓▓░░▓≈≈≈≈≈
░░▓▓'▓▓░▓≈≈≈≈≈ ░░▓▓1▓▓░▓≈≈≈≈≈
░░░▓▓☺▓▓▓≈≈≈≈≈ ░░░▓▓☺▓▓▓≈≈≈≈≈
░░░░▓▓`O▓≈≈≈≈≈ ░░░░▓▓5O▓≈≈≈≈≈
░░░░░▓▓X▓≈≈≈≈≈ ░░░░░▓▓X▓≈≈≈≈≈
░░░▓▓▓▓▓╬≈≈≈≈≈ ░░░▓▓▓▓▓╬≈≈≈≈≈
▓▓▓▓≈≈≈≈≈≈≈≈≈≈ ▓▓▓▓≈≈≈≈≈≈≈≈≈≈
≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈
...either way, (most of, if not all) the water is held back behind the (red) floodgate, and the dwarf is capable of leaving either dry (green) or
slightly wet (blue), as a small drizzle of water leaks through the diagonals.
I then let things settle down a bit (water evaporates
or is low enough level to not bother anyway) and then dig away more of the rock, and remove the temporary pillar I put there, to provide more space for the water I will later let back in.
▓▓▓▓▓▓▓▓▓▓≈≈≈≈
▓X▓▲.,`.'▓≈≈≈≈
▓▓▓▲,'.,▓▓≈≈≈≈
▓▲▲▲.,',▓≈≈≈≈≈
▓,','',`▓≈≈≈≈≈
▓.`.`,.,▓≈≈≈≈≈
▓''`,'`.▓≈≈≈≈≈
▓`.,.,.X▓≈≈≈≈≈
▓.,▓▓▓▓▓╬≈≈≈≈≈
▓▓▓▓≈≈≈≈≈≈≈≈≈≈
≈≈≈≈≈≈≈≈≈≈≈≈≈≈
...note the new ramps (designated here or dug as channels from the level above). Those are just quite useful for dwarfy ingress/egress. And you can put wells above most of these (not the concave corner, probably, but an 'escape ramp' is always useful in case of accidents, anyway).
(I often also like to dig channels
beneath at least one well. One of those up-ramps to Z+1 becomes a downramp leading to Z-1, and should the cistern ever be nominally drained
1 that well, at least, still has some water beneath it to make it active. Oh, and there's more rock-spoil to remove, most likely. Always best to keep these things tidy!)
Then, when all is well (no pun intended!), and there's no work (or workers) in the cistern area, open the floodgate, let it flood to a reasonable level and then close the floodgate again!
▓▓▓▓▓▓▓▓▓▓≈≈≈≈
▓X▓▲76777▓≈≈≈≈
▓▓▓▲7767▓▓≈≈≈≈
▓▲▲▲6777▓≈≈≈≈≈
▓7677767▓≈≈≈≈≈
▓7776777▓≈≈≈≈≈
▓7677767▓≈≈≈≈≈
▓776777X▓≈≈≈≈≈
▓67▓▓▓▓▓╬≈≈≈≈≈
▓▓▓▓≈≈≈≈≈≈≈≈≈≈
≈≈≈≈≈≈≈≈≈≈≈≈≈≈
You now have a decent water-supply (actual quantity dependant on the space you dug out and how long you kept the floodgate open for), which is isolated again from the original water supply (e.g. traversing-fortifications-in-moving-liquid dangers are mitigated against, and I'm always wary about syndrome-producing material contaminating, although I think well-extraction of water handles that aspect, anyway).
But there are other refinements (e.g. in the footnote, below), and you might want to redesign it with
two chambers (a floodgate between each), the innermost one being the well supply (not so demanding, behind its own floodgate to the next chamber), the outermost one being where you drain larger quantities of water away for obsidian making (whilst, perhaps, keeping the floodgate to the watersource open, as well, for maximum supply). And, then, when you want to top up the inner chamber close off the outer-chamber drain to let the outer chamber fill a bit, open the gate to the inner (with or without closing the gate from the source, as well) and rectify any falling levels in the inner.
1 I don't atom-smash, but usually also set a drainage chute away from somewhere else, but following the atom-smashing plan above by building a bridge in some part of this chamber might be your easiest bet...