Many repairs you may need to perform on a toilet require the tank be completely empty. If you are replacing a flapper, it is much easier to complete the task without having to fight a tank full of water. It is also much less messy if the tank is empty when you replace a flush valve. Ensuring the tank is empty and that no more water flows into it is fairly straightforward and takes only a few minutes.
Locate the shutoff valve for the toilet and turn it all the way clockwise to stop the flow of water to the tank. The shutoff valve is toward the floor on the left side of the toilet.
Remove the toilet tank lid and place it somewhere it will not get damaged.
Flush the toilet to remove most of the water in the tank. Since the shutoff valve is turned off, the tank will not refill with water.
Soak up any remaining water in the tank, using a sponge. Wring it out in the toilet bowl or sink.