Turn the water supply off (located below and behind the tank). Drain the water from the tank into a bucket and disconnect the water supply line. Discard the drained water from the tank and replace the bucket (or rags) beneath the tank to protect from spills.
Remove the internal flapper covering the orifice where the water exits from the tank (Image 1).
To remove the gasket underneath the fill tube, remove the tank from the bowl. Unscrew the bolts that hold the tank to the bowl using two wrenches, one to hold the nuts underneath the tank and one to unscrew the screws from inside the tank. The tank is lifted off and the remaining parts are removed (Image 2).
The old gasket is removed and replaced with a new gasket -- follow the manufacturer's instructions to make sure it goes on straight and does not cross-thread (Image 1).
Replace the tank on the bowl and secure it in place with the existing bolts.
Next, install the new fill valve, making sure the new one matches the same model as the old valve. The valve is secured with a lock nut under the tank, and a flexible tube connects the tank's overflow pipe. The flapper is attached last, again, following the manufacturer's specifications (Image 2).