There are several methods. One is to simply dig a chamber somewhere, maybe 5x5, then on the level above it, dig another chamber, but channel holes in the floor at regular intervals. Build some buckets and designate pond zones over the holes, so dwarves will pick up the buckets and fill the "ponds". This will muddy the floor below it. It's a bit tricky to get every tile muddied, and it can take a while, as each fill pond job only transports about 1/7 or 2/7 tiles of water, and water evaporates quickly.
The other method is digging a corridor from the chamber to a water source, say a brook or a natural pond, but leave the last tile intact. Then build a lever and floodgate at the entrance of the chamber and link them up. Now channel the last tile that separates the pond/brook from the corridor from above. Finally, pull the lever to let water into the room. Make sure to pull it again shortly afterwards, so only a little water gets in. If the chamber has no door, excess water can spill into access tunnels and evaporate there.
If you have a natural pond, you can also calculate how much water it contains (tiles * water level (seen with k)), then simply dig a chamber that is large enough to hold all this water next to it. Or let excess water spill into the rest of the fort, where it can evaporate. Quick and dirty.
A bit more involved than the single floodgate method is to build a watergate with two floodgates in the corridor. This way you can fill the watergate, then separate it from the water source by closing the second floodgate, and finally open it into your chamber to fill it with the correct amount of water. For a 5x5 chamber, I recommend building a watergate with 4 tiles between the floodgate, which results in 28 tiles of water, when full.
When working with floodgates, be aware that dwarves might wall themselves in. You can counter this by digging an access stair somewhere in the corridor. This creates another way into your fortress, though. Usually not a big deal, as the corridor is filled with water and walled off by floodgates, which means only aquatic building destroyers could possibly get in.
A more elegant option IMO is to dig the chamber not on the same level as the brook/pond, but on the level above. Then bring the water to the edge of the chamber by digging ramp/stair and corridor towards the watersource. This time you can breach the watersource, because the miner can run from the water and rescue himself to the higher level of the chamber. Finally, build a screwpump on the level above the corridor, with it's butt aligned with the ramp/stair. Then wait until there is some water on the ramp/stair tile and order a dwarf to operate the pump (q hover menu). Make sure to quickly afterwards order the pumping to be stopped, because pumping moves an insane amount of water per second.
You can use floodgates and pumps to build even more intricate water systems, especially when power from a waterwheel or windmill is involved. An idea to enhance the pump solution above would be to have a second access from the chamber to the water-corridor, so that excess water can flow back. And instead of manually operating the pump, you can build a windmill on the level above, bring its power via gear assemblies and axles towards the pump, and link the final gear assembly that connects the windmill and the pump with a lever (maybe build it before the connection is complete). Now you can switch the pump on and off with the pull of a lever.
A final piece of advice when working with levers: Always wait for the connected part to react, before you pull again. Otherwise the lever state and connected part can become out of sync.